projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fbb3b4b
)
* New session variable 'can_receive_im' which indicates that the session is running...
author
Art Cancro
<ajc@citadel.org>
Sun, 31 May 2009 19:33:47 +0000
(19:33 +0000)
committer
Art Cancro
<ajc@citadel.org>
Sun, 31 May 2009 19:33:47 +0000
(19:33 +0000)
citadel/citserver.c
patch
|
blob
|
history
citadel/modules/chat/serv_chat.c
patch
|
blob
|
history
citadel/modules/jabber/serv_xmpp.c
patch
|
blob
|
history
citadel/modules/jabber/xmpp_messages.c
patch
|
blob
|
history
citadel/modules/jabber/xmpp_presence.c
patch
|
blob
|
history
citadel/server.h
patch
|
blob
|
history
diff --git
a/citadel/citserver.c
b/citadel/citserver.c
index df75a28a0d06c4f7c8e0d546d56134ef09ab1439..063c229f8ef40f55554e201cdf6ee860e53e4a2c 100644
(file)
--- a/
citadel/citserver.c
+++ b/
citadel/citserver.c
@@
-1009,8
+1009,8
@@
void citproto_begin_session() {
CC->kill_me = 1;
}
else {
CC->kill_me = 1;
}
else {
- cprintf("%d %s Citadel server ready.\n",
-
CIT_OK, config.c_nodename)
;
+ cprintf("%d %s Citadel server ready.\n",
CIT_OK, config.c_nodename);
+
CC->can_receive_im = 1
;
}
}
}
}
diff --git
a/citadel/modules/chat/serv_chat.c
b/citadel/modules/chat/serv_chat.c
index 2cf3bb233da43313ae483ffc938af174f9dca7be..024cca2e30c2ac76dbc9842a30f62534275d2386 100644
(file)
--- a/
citadel/modules/chat/serv_chat.c
+++ b/
citadel/modules/chat/serv_chat.c
@@
-591,6
+591,7
@@
int send_instant_message(char *lun, char *lem, char *x_user, char *x_msg)
if ( ((!strcasecmp(un, x_user))
|| (!strcasecmp(x_user, "broadcast")))
if ( ((!strcasecmp(un, x_user))
|| (!strcasecmp(x_user, "broadcast")))
+ && (ccptr->can_receive_im)
&& ((ccptr->disable_exp == 0)
|| (CC->user.axlevel >= 6)) ) {
if (do_send) {
&& ((ccptr->disable_exp == 0)
|| (CC->user.axlevel >= 6)) ) {
if (do_send) {
diff --git
a/citadel/modules/jabber/serv_xmpp.c
b/citadel/modules/jabber/serv_xmpp.c
index 94a81036bc2d61c58a26eedc94914e1e2f213e07..988efad2910221388a8b458ad871324db26853e9 100644
(file)
--- a/
citadel/modules/jabber/serv_xmpp.c
+++ b/
citadel/modules/jabber/serv_xmpp.c
@@
-421,6
+421,8
@@
void xmpp_greeting(void) {
XML_SetElementHandler(XMPP->xp, xmpp_xml_start, xmpp_xml_end);
XML_SetCharacterDataHandler(XMPP->xp, xmpp_xml_chardata);
// XML_SetUserData(XMPP->xp, something...);
XML_SetElementHandler(XMPP->xp, xmpp_xml_start, xmpp_xml_end);
XML_SetCharacterDataHandler(XMPP->xp, xmpp_xml_chardata);
// XML_SetUserData(XMPP->xp, something...);
+
+ CC->can_receive_im = 1; /* This protocol is capable of receiving instant messages */
}
}
diff --git
a/citadel/modules/jabber/xmpp_messages.c
b/citadel/modules/jabber/xmpp_messages.c
index 6ae5e83b0df1b1d46d2e7801901983cf8b72c5e7..a49b5f66ca9dd520d9ea30b2b2c1010ab50e7ab7 100644
(file)
--- a/
citadel/modules/jabber/xmpp_messages.c
+++ b/
citadel/modules/jabber/xmpp_messages.c
@@
-89,10
+89,11
@@
void jabber_send_message(char *message_to, char *message_body) {
if (!CC->logged_in) return;
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if (!CC->logged_in) return;
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (cptr->logged_in) {
- if (!strcasecmp(cptr->cs_inet_email, message_to)) {
- recp = cptr->user.fullname;
- }
+ if ( (cptr->logged_in)
+ && (cptr->can_receive_im)
+ && (!strcasecmp(cptr->cs_inet_email, message_to))
+ ) {
+ recp = cptr->user.fullname;
}
}
}
}
diff --git
a/citadel/modules/jabber/xmpp_presence.c
b/citadel/modules/jabber/xmpp_presence.c
index f7f454bb609fd97adc0d63f678a024b8aea03ec5..7ac4439d716c618c4277074ffe083df8a1dd5e14 100644
(file)
--- a/
citadel/modules/jabber/xmpp_presence.c
+++ b/
citadel/modules/jabber/xmpp_presence.c
@@
-63,8
+63,9
@@
void jabber_wholist_presence_dump(void)
for (i=0; i<nContexts; i++) {
if (cptr[i].logged_in) {
if (
for (i=0; i<nContexts; i++) {
if (cptr[i].logged_in) {
if (
- (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide)) /* aides see everyone */
- && (cptr[i].user.usernum != CC->user.usernum) /* don't show myself */
+ (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide)) /* aides see everyone */
+ && (cptr[i].user.usernum != CC->user.usernum) /* don't show myself */
+ && (cptr[i].can_receive_im) /* IM-capable session */
) {
cprintf("<presence type=\"available\" from=\"%s\"></presence>",
cptr[i].cs_inet_email);
) {
cprintf("<presence type=\"available\" from=\"%s\"></presence>",
cptr[i].cs_inet_email);
@@
-96,9
+97,11
@@
void xmpp_presence_notify(char *presence_jid, int event_type) {
/* Count the visible sessions for this user */
for (i=0; i<nContexts; i++) {
if (cptr[i].logged_in) {
/* Count the visible sessions for this user */
for (i=0; i<nContexts; i++) {
if (cptr[i].logged_in) {
- if ( (!strcasecmp(cptr[i].cs_inet_email, presence_jid))
- && (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide))
- ) {
+ if (
+ (!strcasecmp(cptr[i].cs_inet_email, presence_jid))
+ && (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide))
+ && (cptr[i].can_receive_im)
+ ) {
++visible_sessions;
}
}
++visible_sessions;
}
}
diff --git
a/citadel/server.h
b/citadel/server.h
index 9fc9ca6ec2458f798b5d3e230ac74b46770aec02..d78f61907837fedc9c3ad611f66261698ea266c6 100644
(file)
--- a/
citadel/server.h
+++ b/
citadel/server.h
@@
-85,6
+85,7
@@
struct CitContext {
int is_async; /* Nonzero if client accepts async msgs */
int async_waiting; /* Nonzero if there are async msgs waiting */
int input_waiting; /* Nonzero if there is client input waiting */
int is_async; /* Nonzero if client accepts async msgs */
int async_waiting; /* Nonzero if there are async msgs waiting */
int input_waiting; /* Nonzero if there is client input waiting */
+ int can_receive_im; /* Session is capable of receiving instant messages */
/* Client information */
int cs_clientdev; /* client developer ID */
/* Client information */
int cs_clientdev; /* client developer ID */