this_im->conversation = NewStrBuf();
this_im->next = imlist;
imlist = this_im;
- StrBufAppendBufPlain(this_im->conversation, HKEY(
- "<html><body>\r\n"
- ), 0);
+ StrBufAppendBufPlain(this_im->conversation, HKEY("<html><body>\r\n"), 0);
}
-
/* Since it's possible for this function to get called more than once if a user is logged
* in on multiple sessions, we use the message's serial number to keep track of whether
* we've already logged it.
}
-
/*
* Retrieve instant messages
*/
free(ptr);
}
+
/*
* Asynchronously deliver instant messages
*/
cprintf("%d instant msg\n", ASYNC_MSG + ASYNC_GEXP);
}
+
/*
* Back end support function for send_instant_message() and company
*/
}
-
-
/*
* This is the back end to the instant message sending function.
* Returns the number of users to which the message was sent.
return (message_sent);
}
+
/*
* send instant messages
*/
cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
return;
}
- if (CC->fake_username[0])
+ if (CC->fake_username[0]) {
lun = CC->fake_username;
- else
+ }
+ else {
lun = CC->user.fullname;
+ }
lem = CC->cs_inet_email;
message_sent = PerformXmsgHooks(lun, lem, x_user, x_msg);
if (message_sent > 0) {
- if (!IsEmptyStr(x_msg))
+ if (!IsEmptyStr(x_msg)) {
cprintf("%d Message sent", CIT_OK);
- else
+ }
+ else {
cprintf("%d Ok to send message", CIT_OK);
- if (message_sent > 1)
+ }
+ if (message_sent > 1) {
cprintf(" to %d users", message_sent);
+ }
cprintf(".\n");
} else {
- if (CtdlGetUser(NULL, x_user))
- cprintf("%d '%s' does not exist.\n",
- ERROR + NO_SUCH_USER, x_user);
- else
- cprintf("%d '%s' is not logged in "
- "or is not accepting pages.\n",
+ if (CtdlGetUser(NULL, x_user)) {
+ cprintf("%d '%s' does not exist.\n", ERROR + NO_SUCH_USER, x_user);
+ }
+ else {
+ cprintf("%d '%s' is not logged in or is not accepting instant messages.\n",
ERROR + RESOURCE_NOT_OPEN, x_user);
+ }
}
}
-
/*
* Enter or exit paging-disabled mode
*/
FullMsgBuf = NewStrBufPlain(NULL, StrLength(im->conversation) + 100);
StrBufAppendBufPlain(FullMsgBuf, HKEY(
- "Content-type: text/html; charset=UTF-8\r\n"
- "Content-Transfer-Encoding: quoted-printable\r\n"
- "\r\n"
- ), 0);
+ "Content-type: text/html; charset=UTF-8\r\n"
+ "Content-Transfer-Encoding: quoted-printable\r\n"
+ "\r\n"
+ ), 0
+ );
StrBufAppendBuf (FullMsgBuf, MsgBuf, 0);
FreeStrBuf(&MsgBuf);