Changeset 94acdd0


Ignore:
Timestamp:
2008-09-28T11:18:19Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b2c062d
Parents:
e180c59
Message:

Restored support for password-protected chatrooms (for now only by accepting
a password in the IRC JOIN command).

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • chat.c

    re180c59 r94acdd0  
    170170}
    171171
    172 int chat_join( irc_t *irc, struct chat *c )
     172int chat_join( irc_t *irc, struct chat *c, const char *password )
    173173{
    174174        struct groupchat *gc;
     
    178178                nick = irc->nick;
    179179       
    180         if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, NULL ) ) )
     180        if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, password ) ) )
    181181        {
    182182                g_free( gc->channel );
  • chat.h

    re180c59 r94acdd0  
    4444int chat_chanok( char *a );
    4545
    46 int chat_join( irc_t *irc, struct chat *c );
     46int chat_join( irc_t *irc, struct chat *c, const char *password );
  • irc_commands.c

    re180c59 r94acdd0  
    194194        {
    195195                struct chat *c;
    196                 user_t *u;
    197196               
    198197                if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 )
    199198                        irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] );
    200199                else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic )
    201                         chat_join( irc, c );
     200                        chat_join( irc, c, cmd[2] );
    202201                else
    203202                        irc_reply( irc, 403, "%s :No such channel", cmd[1] );
  • lib/xmltree.c

    re180c59 r94acdd0  
    472472}
    473473
    474 struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children )
     474struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children )
    475475{
    476476        struct xt_node *node, *c;
  • lib/xmltree.h

    re180c59 r94acdd0  
    9090char *xt_find_attr( struct xt_node *node, const char *key );
    9191
    92 struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children );
     92struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children );
    9393void xt_add_child( struct xt_node *parent, struct xt_node *child );
    9494void xt_add_attr( struct xt_node *node, const char *key, const char *value );
  • protocols/jabber/conference.c

    re180c59 r94acdd0  
    2626static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    2727
    28 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
     28struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
    2929{
    3030        struct jabber_chat *jc;
  • protocols/jabber/jabber.c

    re180c59 r94acdd0  
    425425}
    426426
    427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
     427static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password )
    428428{
    429429        if( strchr( room, '@' ) == NULL )
  • protocols/jabber/jabber.h

    re180c59 r94acdd0  
    240240
    241241/* conference.c */
    242 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
     242struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
    243243struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
    244244void jabber_chat_free( struct groupchat *c );
  • protocols/nogaim.c

    re180c59 r94acdd0  
    280280               
    281281                if( set_getbool( &c->set, "auto_join" ) )
    282                         chat_join( irc, c );
     282                        chat_join( irc, c, NULL );
    283283        }
    284284}
     
    710710}
    711711
    712 struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
     712struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle )
    713713{
    714714        struct groupchat *c;
  • protocols/nogaim.h

    re180c59 r94acdd0  
    209209         * not implement this. */
    210210        struct groupchat *
    211              (* chat_join)      (struct im_connection *, char *room, char *nick, char *password);
     211             (* chat_join)      (struct im_connection *, const char *room, const char *nick, const char *password);
    212212        /* Change the topic, if supported. Note that BitlBee expects the IM
    213213           server to confirm the topic change with a regular topic change
     
    290290 *   the user her/himself. At that point the group chat will be visible to the
    291291 *   user, too. */
    292 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
     292G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
    293293G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
    294294/* To remove a handle from a group chat. Reason can be NULL. */
  • protocols/oscar/oscar.c

    re180c59 r94acdd0  
    25812581}
    25822582
    2583 struct groupchat *oscar_chat_join(struct im_connection * ic, char * room, char * nick, char * password )
     2583struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
    25842584{
    25852585        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
Note: See TracChangeset for help on using the changeset viewer.