Changeset 0e7ab64 for irc.c


Ignore:
Timestamp:
2007-04-23T02:58:44Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2d317bb
Parents:
43671b9
Message:

Got rid of one HORRIBLE stupidity called chat_by_channel(), which still
used the GLOBAL IM connections list, allowing user A to interfere with
user B's groupchats if running in daemon mode. I can't believe this was
still there...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r43671b9 r0e7ab64  
    658658                }
    659659        }
    660         else if( ( c = chat_by_channel( channel ) ) )
     660        else if( ( c = irc_chat_by_channel( irc, channel ) ) )
    661661        {
    662662                GList *l;
     
    811811        else
    812812        {
    813                 struct groupchat *c = chat_by_channel( channel );
     813                struct groupchat *c = irc_chat_by_channel( irc, channel );
    814814               
    815815                if( c )
     
    949949        if( *nick == '#' || *nick == '&' )
    950950        {
    951                 if( !( c = chat_by_channel( nick ) ) )
     951                if( !( c = irc_chat_by_channel( irc, nick ) ) )
    952952                {
    953953                        irc_reply( irc, 403, "%s :Channel does not exist", nick );
     
    12151215        return TRUE;
    12161216}
     1217
     1218struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel )
     1219{
     1220        struct groupchat *c;
     1221        account_t *a;
     1222       
     1223        /* This finds the connection which has a conversation which belongs to this channel */
     1224        for( a = irc->accounts; a; a = a->next )
     1225        {
     1226                for( c = a->ic->groupchats; c && g_strcasecmp( c->channel, channel ) != 0; c = c->next );
     1227                if( c )
     1228                        return c;
     1229        }
     1230       
     1231        return NULL;
     1232}
Note: See TracChangeset for help on using the changeset viewer.