Changeset 0e7ab64
- Timestamp:
- 2007-04-23T02:58:44Z (18 years ago)
- Branches:
- master
- Children:
- 2d317bb
- Parents:
- 43671b9
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r43671b9 r0e7ab64 658 658 } 659 659 } 660 else if( ( c = chat_by_channel(channel ) ) )660 else if( ( c = irc_chat_by_channel( irc, channel ) ) ) 661 661 { 662 662 GList *l; … … 811 811 else 812 812 { 813 struct groupchat *c = chat_by_channel(channel );813 struct groupchat *c = irc_chat_by_channel( irc, channel ); 814 814 815 815 if( c ) … … 949 949 if( *nick == '#' || *nick == '&' ) 950 950 { 951 if( !( c = chat_by_channel(nick ) ) )951 if( !( c = irc_chat_by_channel( irc, nick ) ) ) 952 952 { 953 953 irc_reply( irc, 403, "%s :Channel does not exist", nick ); … … 1215 1215 return TRUE; 1216 1216 } 1217 1218 struct 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 } -
irc.h
r43671b9 r0e7ab64 140 140 141 141 void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ); 142 struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel ); 142 143 143 144 #endif -
irc_commands.c
r43671b9 r0e7ab64 144 144 irc_join( irc, u, irc->channel ); 145 145 } 146 else if( ( c = chat_by_channel(cmd[1] ) ) )146 else if( ( c = irc_chat_by_channel( irc, cmd[1] ) ) ) 147 147 { 148 148 user_t *u = user_find( irc, irc->nick ); … … 201 201 { 202 202 char *nick = cmd[1], *channel = cmd[2]; 203 struct groupchat *c = chat_by_channel(channel );203 struct groupchat *c = irc_chat_by_channel( irc, channel ); 204 204 user_t *u = user_find( irc, nick ); 205 205 … … 287 287 u = u->next; 288 288 } 289 else if( ( c = chat_by_channel(channel ) ) )289 else if( ( c = irc_chat_by_channel( irc, channel ) ) ) 290 290 for( l = c->in_room; l; l = l->next ) 291 291 { -
protocols/jabber/conference.c
r43671b9 r0e7ab64 102 102 103 103 /* Not really the same syntax as the normal pkt_ functions, but this isn't 104 called by the xmltree parser exactly and this way I can add some extra104 called by the xmltree parser directly and this way I can add some extra 105 105 parameters so we won't have to repeat too many things done by the caller 106 106 already. */ … … 151 151 if( s ) *s = '/'; 152 152 } 153 else if( type ) /* This only gets called if type =="unavailable" */153 else if( type ) /* This only gets called if type is NULL or "unavailable" */ 154 154 { 155 155 /* Won't handle this for now. */ -
protocols/nogaim.c
r43671b9 r0e7ab64 856 856 /* Misc. BitlBee stuff which shouldn't really be here */ 857 857 858 struct groupchat *chat_by_channel( char *channel )859 {860 struct im_connection *ic;861 struct groupchat *c;862 GSList *l;863 864 /* This finds the connection which has a conversation which belongs to this channel */865 for( l = connections; l; l = l->next )866 {867 ic = l->data;868 for( c = ic->groupchats; c && g_strcasecmp( c->channel, channel ) != 0; c = c->next );869 if( c )870 return c;871 }872 873 return NULL;874 }875 876 858 char *set_eval_away_devoice( set_t *set, char *value ) 877 859 { -
protocols/nogaim.h
r43671b9 r0e7ab64 207 207 G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at ); 208 208 G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c ); 209 struct groupchat *chat_by_channel( char *channel );210 209 211 210 /* Actions, or whatever. */ -
root_commands.c
r43671b9 r0e7ab64 918 918 char *s; 919 919 920 channel = g_strdup (chat );920 channel = g_strdup_printf( "&%s", chat ); 921 921 if( ( s = strchr( channel, '@' ) ) ) 922 922 *s = 0; … … 928 928 if( cmd[3] && cmd[4] && cmd[5] ) 929 929 password = cmd[5]; 930 931 if( channel[0] != '#' && channel[0] != '&' ) 932 { 933 irc_usermsg( irc, "Invalid channel name: %s", channel ); 934 g_free( channel ); 935 return; 936 } 937 else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) ) 938 { 939 irc_usermsg( irc, "Channel already exists: %s", channel ); 940 g_free( channel ); 941 return; 942 } 930 943 931 944 if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) )
Note: See TracChangeset
for help on using the changeset viewer.