From: Art Cancro Date: Tue, 23 Feb 2010 16:28:58 +0000 (+0000) Subject: * Tweaked some of the XMPP stanzas to include a valid 'to=' parameter. The presence... X-Git-Tag: v7.86~384 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7c807ee725e45d0218cf7178c2ca7f0b8c8516b3 * Tweaked some of the XMPP stanzas to include a valid 'to=' parameter. The presence of online buddies at login time is now working again in the current version of Pidgin. Unsolicited events are still not being received at all, however. This includes incoming instant messages and presence/nonpresence updates which occur during the session. --- diff --git a/citadel/modules/xmpp/xmpp_messages.c b/citadel/modules/xmpp/xmpp_messages.c index 5ea435d4a..2544867d4 100644 --- a/citadel/modules/xmpp/xmpp_messages.c +++ b/citadel/modules/xmpp/xmpp_messages.c @@ -3,21 +3,21 @@ * * Handle messages sent and received using XMPP (Jabber) protocol * - * Copyright (c) 2007-2009 by Art Cancro + * Copyright (c) 2007-2010 by Art Cancro * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index 9eaf88728..141b2d3fd 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -59,6 +59,20 @@ #include "serv_xmpp.h" + +/* + * Indicate the presence of another user to the client + * (used in several places) + */ +void xmpp_indicate_presence(char *presence_jid) +{ + cprintf("", + presence_jid, + XMPP->client_jid + ); +} + + /* * Initial dump of the entire wholist */ @@ -81,8 +95,7 @@ void xmpp_wholist_presence_dump(void) && (cptr[i].user.usernum != CC->user.usernum) /* don't show myself */ && (cptr[i].can_receive_im) /* IM-capable session */ ) { - cprintf("", - cptr[i].cs_inet_email); + xmpp_indicate_presence(cptr[i].cs_inet_email); } } } @@ -98,11 +111,20 @@ void xmpp_destroy_buddy(char *presence_jid) { static int unsolicited_id = 1; /* Transmit non-presence information */ - cprintf("", presence_jid); - cprintf("", presence_jid); + cprintf("", + presence_jid, XMPP->client_jid + ); + cprintf("", + presence_jid, XMPP->client_jid + ); + // FIXME ... we should implement xmpp_indicate_nonpresence so we can use it elsewhere /* Do an unsolicited roster update that deletes the contact. */ - cprintf("", ++unsolicited_id); + cprintf("", + CC->cs_inet_email, + XMPP->client_jid, + ++unsolicited_id + ); cprintf(""); cprintf("", presence_jid); cprintf("%s", config.c_humannode); @@ -166,7 +188,7 @@ void xmpp_presence_notify(char *presence_jid, int event_type) { } /* Transmit presence information */ - cprintf("", presence_jid); + xmpp_indicate_presence(presence_jid); } if (visible_sessions == 0) {