From vapspcx@cad.gatech.edu Wed Jan 12 17:43:42 1994
Return-Path: <vapspcx@cad.gatech.edu>
Received: from cad.gatech.edu by mik.uky.edu (NX5.67d/NX3.0M)
	id AA14380; Wed, 12 Jan 94 17:43:41 -0500
Received: from cae.cad.gatech.edu by cad.gatech.edu with SMTP id AA21015
  (5.65c/IDA-1.4.4 for <uk09242@mik.uky.edu>); Wed, 12 Jan 1994 17:45:30 -0500
Date: Wed, 12 Jan 1994 17:45:30 -0500
From: "S. Keith Graham" <vapspcx@cad.gatech.edu>
Message-Id: <199401122245.AA21015@cad.gatech.edu>
To: uk09242@mik.uky.edu
Subject: senduser.c
Status: RO


#include "server.h"

static char buff2[256];
char buff[256];

int
sendline(n,s)
int n;
char *s;
{
buff[0] = (unsigned char) strlen(s) + 1;
strcpy(&(buff[1]),s);

return (packetsend(n,buff));
}

void
user_open(to,from,msg)
int to;
char *from, *msg;
{ 
sprintf(buff2,"%c%s\001%s\000",M_OPEN,from,msg);
sendline(to,buff2);
}

void
user_personal(to,from,msg)
int to;
char *from, *msg;
{ 
sprintf(buff2,"%c%s\001%s\000",M_PERSONAL,from,msg);
sendline(to,buff2);
}

void
user_beep(to,from)
int to;
char *from;
{ 
char tempbuff[MAX_NICKLEN+MAX_IDLEN+5];

strcpy(tempbuff, from);
sprintf(buff2,"%c%s\000",M_BEEP,tempbuff);
sendline(to,buff2);
}

void
user_exit(to)
int to;
{ 
sprintf(buff2,"%c\000",M_EXIT);
sendline(to,buff2);
}

void
user_loginok(to)
int to;
{ 
sprintf(buff2,"%c\000",M_LOGINOK);
sendline(to,buff2);
}

void
user_status(to,type,msg)
int to;
char *type, *msg;
{ 
sprintf(buff2,"%c%s\001%s\000",M_STATUS,type,msg);
sendline(to,buff2);
}

void
user_important(to,type,msg)
int to;
char *type, *msg;
{ 
sprintf(buff2,"%c%s\001%s\000",M_IMPORTANT,type,msg);
sendline(to,buff2);
}

void
user_error(to,msg)
int to;
char *msg;
{ 
sprintf(buff2,"%c%s\000",M_ERROR,msg);
sendline(to,buff2);
}

void
user_command(to,msg)
int to;
char *msg;
{ 
sprintf(buff2,"%cxx\001%s\000",M_CMDOUT,msg);
sendline(to,buff2);
}

void
user_wline(to,mod,nick,idle,resp,login,user,site,name)
int to;
char *mod,*nick;
int idle, resp, login;
char *user, *site, *name;
{ 
sprintf(buff2,"%cwl\001%s\001%s\001%ld\001%ld\001%ld\001%s\001%s\000",
			M_CMDOUT,mod,nick,idle,resp,login,
				user,site,name);
sendline(to,buff2);
}

void
user_wgroupline(to,group,topic)
int to;
char *group,*topic;
{ 
sprintf(buff2,"%cwg\001%s\001%s\000",M_CMDOUT,group,topic);
sendline(to,buff2);
}

void
user_ghead(to)
int to;
{ 
sprintf(buff2,"%cgh\000",M_CMDOUT);
sendline(to,buff2);
}

void
user_whead(to)
int to;
{ 
sprintf(buff2,"%cwh\000",M_CMDOUT);
sendline(to,buff2);
}

