Changeset 46d215d


Ignore:
Timestamp:
2010-06-08T23:43:13Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6acc033
Parents:
d7db346
Message:

Allow moving contacts around between groups. Works with at least Jabber,
will check the others now.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    rd7db346 r46d215d  
    359359}
    360360
     361static gboolean control_channel_invite( irc_channel_t *ic, irc_user_t *iu )
     362{
     363        struct irc_control_channel *icc = ic->data;
     364        bee_user_t *bu = iu->bu;
     365       
     366        if( bu == NULL )
     367                return FALSE;
     368       
     369        if( icc->type != IRC_CC_TYPE_GROUP )
     370        {
     371                irc_send_num( ic->irc, 482, "%s :Invitations are only possible to fill_by=group channels", ic->name );
     372                return FALSE;
     373        }
     374       
     375        bu->ic->acc->prpl->add_buddy( bu->ic, bu->handle,
     376                                      icc->group ? icc->group->name : NULL );
     377       
     378        return TRUE;
     379}
     380
    361381static char *set_eval_by_account( set_t *set, char *value );
    362382static char *set_eval_fill_by( set_t *set, char *value );
     
    456476        NULL,
    457477        NULL,
    458         NULL,
     478        control_channel_invite,
    459479       
    460480        control_channel_init,
  • irc_commands.c

    rd7db346 r46d215d  
    403403        }
    404404       
    405         if( !ic->f->invite || !ic->f->invite( ic, iu ) )
     405        if( !ic->f->invite )
    406406                irc_send_num( irc, 482, "%s :Can't invite people here", cmd[2] );
     407        else if( ic->f->invite( ic, iu ) )
     408                irc_send_num( irc, 341, "%s %s", iu->nick, ic->name );
    407409}
    408410
  • protocols/jabber/iq.c

    rd7db346 r46d215d  
    555555static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    556556
    557 int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name )
     557int jabber_add_to_roster( struct im_connection *ic, const char *handle, const char *name, const char *group )
    558558{
    559559        struct xt_node *node;
     
    565565        if( name )
    566566                xt_add_attr( node, "name", name );
     567        if( group )
     568                xt_add_child( node, xt_new_node( "group", group, NULL ) );
    567569       
    568570        /* And pack it into a roster-add packet */
  • protocols/jabber/jabber.c

    rd7db346 r46d215d  
    413413        }
    414414       
    415         if( jabber_add_to_roster( ic, who, NULL ) )
     415        if( jabber_add_to_roster( ic, who, NULL, group ) )
    416416                presence_send_request( ic, who, "subscribe" );
    417417}
  • protocols/jabber/jabber.h

    rd7db346 r46d215d  
    235235int jabber_get_roster( struct im_connection *ic );
    236236int jabber_get_vcard( struct im_connection *ic, char *bare_jid );
    237 int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name );
     237int jabber_add_to_roster( struct im_connection *ic, const char *handle, const char *name, const char *group );
    238238int jabber_remove_from_roster( struct im_connection *ic, char *handle );
    239239xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid );
  • root_commands.c

    rd7db346 r46d215d  
    622622       
    623623        if( add_on_server )
    624                 a->ic->acc->prpl->add_buddy( a->ic, cmd[2], NULL );
     624                a->prpl->add_buddy( a->ic, cmd[2], NULL );
    625625        else
    626626                /* Only for add -tmp. For regular adds, this callback will
Note: See TracChangeset for help on using the changeset viewer.