Changeset bb151f7
- Timestamp:
- 2010-11-20T20:25:44Z (14 years ago)
- Branches:
- master
- Children:
- 748bcdd
- Parents:
- d68365c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
rd68365c rbb151f7 287 287 int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, irc_channel_del_user_type_t type, const char *msg ); 288 288 irc_channel_user_t *irc_channel_has_user( irc_channel_t *ic, irc_user_t *iu ); 289 struct irc_channel *irc_channel_with_user( irc_t *irc, irc_user_t *iu ); 289 290 int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_t *who ); 290 291 void irc_channel_user_set_mode( irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags ); -
irc_channel.c
rd68365c rbb151f7 287 287 if( icu->iu == iu ) 288 288 return icu; 289 } 290 291 return NULL; 292 } 293 294 /* Find a channel we're currently in, that currently has iu in it. */ 295 struct irc_channel *irc_channel_with_user( irc_t *irc, irc_user_t *iu ) 296 { 297 GSList *l; 298 299 for( l = irc->channels; l; l = l->next ) 300 { 301 irc_channel_t *ic = l->data; 302 303 if( strcmp( set_getstr( &ic->set, "type" ), "control" ) != 0 ) 304 continue; 305 306 if( ( ic->flags & IRC_CHANNEL_JOINED ) && 307 irc_channel_has_user( ic, iu ) ) 308 return ic; 309 } 310 311 /* If there was no match, try once more but just see if the user 312 *would* be in the channel, i.e. if s/he were online. */ 313 if( iu->bu == NULL ) 314 return NULL; 315 316 for( l = irc->channels; l; l = l->next ) 317 { 318 irc_channel_t *ic = l->data; 319 320 if( strcmp( set_getstr( &ic->set, "type" ), "control" ) != 0 ) 321 continue; 322 323 if( ( ic->flags & IRC_CHANNEL_JOINED ) && 324 irc_channel_wants_user( ic, iu ) ) 325 return ic; 289 326 } 290 327 -
irc_im.c
rd68365c rbb151f7 54 54 bu->ui_data = iu = irc_user_new( irc, nick ); 55 55 iu->bu = bu; 56 57 if( set_getbool( &irc->b->set, "private" ) ) 58 iu->last_channel = NULL; 59 else 60 iu->last_channel = irc_channel_with_user( irc, iu ); 56 61 57 62 if( ( s = strchr( bu->handle, '@' ) ) ) … … 210 215 if( iu->last_channel->flags & IRC_CHANNEL_JOINED ) 211 216 ic = iu->last_channel; 212 else if( irc->default_channel->flags & IRC_CHANNEL_JOINED )213 ic = irc ->default_channel;217 else 218 ic = irc_channel_with_user( irc, iu ); 214 219 } 215 220 -
irc_send.c
rd68365c rbb151f7 127 127 if( iu->last_channel->flags & IRC_CHANNEL_JOINED ) 128 128 ic = iu->last_channel; 129 else if( irc->default_channel->flags & IRC_CHANNEL_JOINED )130 ic = irc ->default_channel;129 else 130 ic = irc_channel_with_user( irc, irc->root ); 131 131 } 132 132 -
irc_user.c
rd68365c rbb151f7 34 34 iu->nick = g_strdup( nick ); 35 35 iu->user = iu->host = iu->fullname = iu->nick; 36 37 if( set_getbool( &irc->b->set, "private" ) )38 iu->last_channel = NULL;39 else40 iu->last_channel = irc->default_channel;41 36 42 37 iu->key = g_strdup( nick );
Note: See TracChangeset
for help on using the changeset viewer.