Changeset 0b5cc72 for irc_user.c
- Timestamp:
- 2010-04-05T00:39:04Z (14 years ago)
- Branches:
- master
- Children:
- 57c96f7
- Parents:
- 1d39159
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_user.c
r1d39159 r0b5cc72 83 83 } 84 84 85 int irc_user_ rename( irc_t *irc, const char *old, const char *new )85 int irc_user_set_nick( irc_t *irc, const char *old, const char *new ) 86 86 { 87 87 irc_user_t *iu = irc_user_by_name( irc, old ); 88 88 char key[strlen(new)+1]; 89 GSList *cl; 89 90 90 91 strcpy( key, new ); 91 92 if( iu == NULL || !nick_lc( key ) || irc_user_by_name( irc, new ) ) 92 93 return 0; 94 95 for( cl = irc->channels; cl; cl = cl->next ) 96 { 97 irc_channel_t *ic = cl->data; 98 99 /* Send a NICK update if we're renaming our user, or someone 100 who's in the same channel like our user. */ 101 if( iu == irc->user || 102 ( irc_channel_has_user( ic, irc->user ) && 103 irc_channel_has_user( ic, iu ) ) ) 104 { 105 irc_send_nick( iu, new ); 106 break; 107 } 108 } 93 109 94 110 irc->users = g_slist_remove( irc->users, iu );
Note: See TracChangeset
for help on using the changeset viewer.