projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a10f5aa
)
more minor style cleanups
author
Art Cancro
<ajc@citadel.org>
Thu, 18 Oct 2018 22:07:43 +0000
(18:07 -0400)
committer
Art Cancro
<ajc@citadel.org>
Thu, 18 Oct 2018 22:07:43 +0000
(18:07 -0400)
citadel/modules/instmsg/serv_instmsg.c
patch
|
blob
|
history
diff --git
a/citadel/modules/instmsg/serv_instmsg.c
b/citadel/modules/instmsg/serv_instmsg.c
index 5915ab6c7afc1b7cc9122a0d604c25dec55088b6..1bf8c728a9877ca1b6cd35fa7030b70214d73c39 100644
(file)
--- a/
citadel/modules/instmsg/serv_instmsg.c
+++ b/
citadel/modules/instmsg/serv_instmsg.c
@@
-110,12
+110,9
@@
void log_instant_message(struct CitContext *me, struct CitContext *them, char *m
this_im->conversation = NewStrBuf();
this_im->next = imlist;
imlist = this_im;
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.
/* 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.
@@
-152,7
+149,6
@@
void delete_instant_messages(void) {
}
}
-
/*
* Retrieve instant messages
*/
/*
* Retrieve instant messages
*/
@@
-188,6
+184,7
@@
void cmd_gexp(char *argbuf) {
free(ptr);
}
free(ptr);
}
+
/*
* Asynchronously deliver instant messages
*/
/*
* Asynchronously deliver instant messages
*/
@@
-202,6
+199,7
@@
void cmd_gexp_async(void) {
cprintf("%d instant msg\n", ASYNC_MSG + ASYNC_GEXP);
}
cprintf("%d instant msg\n", ASYNC_MSG + ASYNC_GEXP);
}
+
/*
* Back end support function for send_instant_message() and company
*/
/*
* Back end support function for send_instant_message() and company
*/
@@
-227,8
+225,6
@@
void add_xmsg_to_context(struct CitContext *ccptr, struct ExpressMessage *newmsg
}
}
-
-
/*
* This is the back end to the instant message sending function.
* Returns the number of users to which the message was sent.
/*
* This is the back end to the instant message sending function.
* Returns the number of users to which the message was sent.
@@
-289,6
+285,7
@@
int send_instant_message(char *lun, char *lem, char *x_user, char *x_msg)
return (message_sent);
}
return (message_sent);
}
+
/*
* send instant messages
*/
/*
* send instant messages
*/
@@
-305,10
+302,12
@@
void cmd_sexp(char *argbuf)
cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
return;
}
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;
lun = CC->fake_username;
- else
+ }
+ else {
lun = CC->user.fullname;
lun = CC->user.fullname;
+ }
lem = CC->cs_inet_email;
lem = CC->cs_inet_email;
@@
-358,21
+357,24
@@
void cmd_sexp(char *argbuf)
message_sent = PerformXmsgHooks(lun, lem, x_user, x_msg);
if (message_sent > 0) {
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);
cprintf("%d Message sent", CIT_OK);
- else
+ }
+ else {
cprintf("%d Ok to send message", CIT_OK);
cprintf("%d Ok to send message", CIT_OK);
- if (message_sent > 1)
+ }
+ if (message_sent > 1) {
cprintf(" to %d users", message_sent);
cprintf(" to %d users", message_sent);
+ }
cprintf(".\n");
} else {
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);
ERROR + RESOURCE_NOT_OPEN, x_user);
+ }
}
}
@@
-380,7
+382,6
@@
void cmd_sexp(char *argbuf)
}
}
-
/*
* Enter or exit paging-disabled mode
*/
/*
* Enter or exit paging-disabled mode
*/
@@
-457,10
+458,11
@@
void flush_individual_conversation(struct imlog *im) {
FullMsgBuf = NewStrBufPlain(NULL, StrLength(im->conversation) + 100);
StrBufAppendBufPlain(FullMsgBuf, HKEY(
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);
StrBufAppendBuf (FullMsgBuf, MsgBuf, 0);
FreeStrBuf(&MsgBuf);