Changeset f8feb8a


Ignore:
Timestamp:
2015-05-07T10:33:06Z (5 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
0ace810
Parents:
e9face7
Message:

add_buddy and remove_buddy should no longer be mandatory.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    re9face7 rf8feb8a  
    724724        }
    725725
     726        if (!bu->ic->acc->prpl->add_buddy) {
     727                irc_send_num(ic->irc, 482, "%s :IM protocol does not support contact list modification", ic->name);
     728                return FALSE;
     729        }
     730
    726731        bu->ic->acc->prpl->add_buddy(bu->ic, bu->handle,
    727732                                     icc->group ? icc->group->name : NULL);
     
    741746        if (icc->type != IRC_CC_TYPE_GROUP) {
    742747                irc_send_num(ic->irc, 482, "%s :Kicks are only possible to fill_by=group channels", ic->name);
     748                return;
     749        }
     750
     751        if (!bu->ic->acc->prpl->remove_buddy) {
     752                irc_send_num(ic->irc, 482, "%s :IM protocol does not support contact list modification", ic->name);
    743753                return;
    744754        }
  • protocols/rpc/rpc.c

    re9face7 rf8feb8a  
    883883        RPC_ADD_OPT_FUNC(set_away);
    884884        RPC_ADD_OPT_FUNC(send_typing);
    885         RPC_ADD_FUNC(add_buddy);     /* Consider making these two optional? */
    886         RPC_ADD_FUNC(remove_buddy);
     885        RPC_ADD_OPT_FUNC(add_buddy);
     886        RPC_ADD_OPT_FUNC(remove_buddy);
    887887        RPC_ADD_OPT_FUNC(add_permit);
    888888        RPC_ADD_OPT_FUNC(add_deny);
  • python/implugin.py

    re9face7 rf8feb8a  
    1616# BitlBee which functions are actually implemented so omitted features
    1717# will be disabled, but note that some/many functions are simply mandatory.
    18 # (Currently login/-out, buddy_msg, add/remove_buddy.)
     18# (Currently login/-out, buddy_msg.)
    1919SUPPORTED_FUNCTIONS = [
    2020        'login', 'keepalive', 'logout', 'buddy_msg', 'set_away',
     
    119119                self.bee.error("Ok bye!")
    120120
    121         def add_buddy(self, handle, group):
    122                 return False
    123        
    124         def remove_buddy(self, handle, group):
    125                 return False
    126        
    127121        def buddy_msg(self, handle, msg, flags):
    128122                feed = self.feeds[handle]
  • root_commands.c

    re9face7 rf8feb8a  
    647647                irc_rootmsg(irc, "That account is not on-line");
    648648                return;
     649        } else if (add_on_server && !a->prpl->add_buddy) {
     650                irc_rootmsg(irc, "IM protocol does not support contact list modification");
     651                return;
    649652        }
    650653
     
    717720        s = g_strdup(bu->handle);
    718721
    719         bu->ic->acc->prpl->remove_buddy(bu->ic, bu->handle, NULL);
     722        if (bu->ic->acc->prpl->remove_buddy) {
     723                bu->ic->acc->prpl->remove_buddy(bu->ic, bu->handle, NULL);
     724        } else {
     725                irc_rootmsg(irc, "IM protocol does not support contact list modification, "
     726                                 "removal will likely not be permanent");
     727        }
     728
    720729        nick_del(bu);
    721730        if (g_slist_find(irc->users, iu)) {
Note: See TracChangeset for help on using the changeset viewer.