[JDEV] Static shared groups that show presence

vtjabber at dennis.veritime.com vtjabber at dennis.veritime.com
Wed Jul 31 12:31:53 CDT 2002


>   After banging my head against the wall reading a bunch of out-of-date
> and incomplete Jabber documentation on shared groups (mod_groups), I
> finally resorted to reading and hacking the mod_groups.c code a little.
> ...
>   Comments?  I want to make sure I've modified the correct line, and that
> it won't have any unintended side-effects...

  An update for those interested:

  Causing static shared groups to call mod_groups_presence_from() adds
JIDs to each group table's "from" list.

  Neglecting to remove these JIDs after a corresponding logout leaves
dangling pointers, which eventaully causes seg faults.  Here's a version
that hopefully clears that up.

-Dan

--- mod_groups.c        Fri Feb  8 02:39:28 2002
+++ mod_groups.c_new    Wed Jul 31 11:01:33 2002
@@ -823,7 +823,8 @@

         gt = GROUP_GET(mi,gid);

-        if(j_strcmp(xmlnode_get_attrib(cur,"type"),"both") == 0)
+        /* Make static groups also send presence */
+        /* if(j_strcmp(xmlnode_get_attrib(cur,"type"),"both") == 0) */
             mod_groups_presence_from(s,gt,m->packet->x);

         /* if we are new or our old priority was less then zero then "probe" the group members */
@@ -866,7 +867,8 @@
         gt = (grouptab) xhash_get(mi->groups,xmlnode_get_attrib(cur,"id"));
         if (gt == NULL) continue;

-        if(j_strcmp(xmlnode_get_attrib(cur,"type"),"both") == 0)
+        /* Make static groups also send presence */
+        /* if(j_strcmp(xmlnode_get_attrib(cur,"type"),"both") == 0) */
             xhash_zap(gt->from,jid_full(id));

         xhash_zap(gt->to,jid_full(id));




More information about the JDev mailing list