Changes in / [21a328ab:2378eca2]


Ignore:
Location:
protocols/jabber
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/block.c

    r21a328ab r2378eca2  
    2323
    2424#include "jabber.h"
     25
     26int jabber_block_feature(struct im_connection *ic)
     27{
     28        struct jabber_data *jd = ic->proto_data;
     29        GSList *features = jd->features;
     30        int foundbk = FALSE;
     31        struct prpl *prpl = ic->acc->prpl;
     32
     33        while (features) {
     34                if (!strcmp(features->data, XMLNS_BLOCK)) {
     35                        foundbk = TRUE;
     36                }
     37                features = g_slist_next(features);
     38        }
     39
     40        if (foundbk) {
     41                prpl->add_deny = jabber_buddy_block;
     42                prpl->rem_deny = jabber_buddy_unblock;
     43                prpl->add_permit = jabber_buddy_permit;
     44                prpl->rem_permit = jabber_buddy_unpermit;
     45        } else {
     46                prpl->add_deny = NULL;
     47                prpl->rem_deny = NULL;
     48                prpl->add_permit = NULL;
     49                prpl->rem_permit = NULL;
     50        }
     51
     52        return foundbk;
     53}
    2554
    2655void jabber_buddy_blockunblock(struct im_connection *ic, char *who, int block)
     
    5887}
    5988
    60 //jabber doesn't have permit lists so these are empty
    6189void jabber_buddy_permit(struct im_connection *ic, char *who)
    6290{
    6391}
    64 
    6592void jabber_buddy_unpermit(struct im_connection *ic, char *who)
    6693{
  • protocols/jabber/iq.c

    r21a328ab r2378eca2  
    10071007{
    10081008        struct jabber_data *jd = ic->proto_data;
    1009     struct prpl *prpl = ic->acc->prpl;
    10101009        struct xt_node *query, *id, *c;
    10111010        char *feature;
     
    10151014        }
    10161015
    1017     if (xt_find_node_by_attr(query->children, "feature", "var", XMLNS_BLOCK)) {
    1018         prpl->add_deny = jabber_buddy_block;
    1019         prpl->rem_deny = jabber_buddy_unblock;
    1020         prpl->add_permit = jabber_buddy_permit;
    1021         prpl->rem_permit = jabber_buddy_unpermit;
    1022     }
     1016        c = query->children;
     1017
     1018        while ((c = xt_find_node(c, "feature"))) {
     1019                feature = xt_find_attr(c, "var");
     1020                if (feature) {
     1021                        jd->features = g_slist_append(jd->features, g_strdup(feature));
     1022                }
     1023                c = c->next;
     1024        }
    10231025
    10241026        if (xt_find_node_by_attr(query->children, "feature", "var", XMLNS_CARBONS) &&
     
    10491051                }
    10501052        }
     1053
     1054        jabber_block_feature(ic);
    10511055
    10521056        return XT_HANDLED;
  • protocols/jabber/jabber.h

    r21a328ab r2378eca2  
    109109        GHashTable *buddies;
    110110
     111        GSList *features;
    111112        GSList *filetransfers;
    112113        GSList *streamhosts;
Note: See TracChangeset for help on using the changeset viewer.