Changeset eb37735
- Timestamp:
- 2010-05-08T23:54:37Z (15 years ago)
- Branches:
- master
- Children:
- 36577aa
- Parents:
- 66b9e36a
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r66b9e36a reb37735 131 131 { 132 132 IRC_CHANNEL_JOINED = 1, 133 IRC_CHANNEL_CONTACTS = 256, 133 134 /* Hack: Set this flag right before jumping into IM when we expect 135 a call to imcb_chat_new(). */ 136 IRC_CHANNEL_CHAT_PICKME = 0x10000, 134 137 } irc_channel_flags_t; 135 138 -
irc_channel.c
r66b9e36a reb37735 28 28 static gint irc_channel_user_cmp( gconstpointer a_, gconstpointer b_ ); 29 29 static const struct irc_channel_funcs control_channel_funcs; 30 static const struct irc_channel_funcs groupchat_stub_funcs; 30 31 31 32 irc_channel_t *irc_channel_new( irc_t *irc, const char *name ) … … 37 38 38 39 ic = g_new0( irc_channel_t, 1 ); 39 ic->f = &control_channel_funcs;40 40 ic->irc = irc; 41 41 ic->name = g_strdup( name ); … … 48 48 49 49 irc->channels = g_slist_prepend( irc->channels, ic ); 50 51 if( name[0] == '&' ) 52 ic->f = &control_channel_funcs; 53 else /* if( name[0] == '#' ) */ 54 ic->f = &groupchat_stub_funcs; 50 55 51 56 return ic; … … 251 256 control_channel_privmsg, 252 257 }; 258 259 /* Groupchat stub: Only handles /INVITE at least for now. */ 260 static gboolean groupchat_stub_invite( irc_channel_t *ic, irc_user_t *iu ) 261 { 262 bee_user_t *bu = iu->bu; 263 264 if( iu->bu->ic->acc->prpl->chat_with ) 265 { 266 ic->flags |= IRC_CHANNEL_CHAT_PICKME; 267 iu->bu->ic->acc->prpl->chat_with( bu->ic, bu->handle ); 268 ic->flags &= ~IRC_CHANNEL_CHAT_PICKME; 269 return TRUE; 270 } 271 else 272 { 273 irc_send_num( ic->irc, 482, "%s :IM protocol does not support room invitations", ic->name ); 274 return FALSE; 275 } 276 } 277 278 static const struct irc_channel_funcs groupchat_stub_funcs = { 279 NULL, 280 NULL, 281 NULL, 282 NULL, 283 groupchat_stub_invite, 284 }; -
irc_im.c
r66b9e36a reb37735 259 259 irc_channel_t *ic; 260 260 char *topic; 261 GSList *l; 261 262 int i; 262 263 263 for( i = 0; i <= 999; i ++ ) 264 /* Try to find a channel that expects to receive a groupchat. 265 This flag is set by groupchat_stub_invite(). */ 266 for( l = irc->channels; l; l = l->next ) 267 { 268 ic = l->data; 269 if( ic->flags & IRC_CHANNEL_CHAT_PICKME ) 270 break; 271 } 272 273 /* If we found none, just generate some stupid name. */ 274 if( l == NULL ) for( i = 0; i <= 999; i ++ ) 264 275 { 265 276 char name[16];
Note: See TracChangeset
for help on using the changeset viewer.