]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/jabber/xmpp_presence.c
* More license declarations
[citadel.git] / citadel / modules / jabber / xmpp_presence.c
index f7f454bb609fd97adc0d63f678a024b8aea03ec5..96b4504b8ba9a267448342e106a699728359ca13 100644 (file)
@@ -3,8 +3,21 @@
  *
  * Handle XMPP presence exchanges
  *
- * Copyright (c) 2007 by Art Cancro
- * This code is released under the terms of the GNU General Public License.
+ * Copyright (c) 2007-2009 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 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
  *
  */
 
@@ -63,8 +76,9 @@ void jabber_wholist_presence_dump(void)
        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);
@@ -96,9 +110,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) {
-                       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;
                        }
                }