Changeset d06eabf
- Timestamp:
- 2007-06-04T13:22:05Z (18 years ago)
- Branches:
- master
- Children:
- e0e2a71
- Parents:
- 54f2f55
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
nick.c
r54f2f55 rd06eabf 57 57 static char nick[MAX_NICK_LENGTH+1]; 58 58 char *store_handle, *found_nick; 59 int inf_protection = 256;60 59 61 60 memset( nick, 0, MAX_NICK_LENGTH + 1 ); … … 82 81 } 83 82 g_free( store_handle ); 83 84 /* Make sure the nick doesn't collide with an existing one by adding 85 underscores and that kind of stuff, if necessary. */ 86 nick_dedupe( acc, handle, nick ); 87 88 return nick; 89 } 90 91 void nick_dedupe( account_t *acc, const char *handle, char nick[MAX_NICK_LENGTH+1] ) 92 { 93 int inf_protection = 256; 84 94 85 95 /* Now, find out if the nick is already in use at the moment, and make … … 120 130 } 121 131 } 122 123 return nick;124 132 } 125 133 -
nick.h
r54f2f55 rd06eabf 26 26 void nick_set( account_t *acc, const char *handle, const char *nick ); 27 27 char *nick_get( account_t *acc, const char *handle ); 28 void nick_dedupe( account_t *acc, const char *handle, char nick[MAX_NICK_LENGTH+1] ); 28 29 int nick_saved( account_t *acc, const char *handle ); 29 30 void nick_del( account_t *acc, const char *handle ); -
protocols/jabber/conference.c
r54f2f55 rd06eabf 160 160 imcb_chat_add_buddy( chat, bud->ext_jid ); 161 161 if( s ) *s = '/'; 162 163 if( bud != jc->me ) 164 imcb_buddy_nick_hint( ic, bud->ext_jid, bud->resource ); 162 165 } 163 166 else if( type ) /* This only gets called if type is NULL or "unavailable" */ -
protocols/jabber/iq.c
r54f2f55 rd06eabf 373 373 group->text : NULL ); 374 374 375 imcb_rename_buddy( ic, jid, name ); 375 if( name ) 376 { 377 imcb_rename_buddy( ic, jid, name ); 378 imcb_buddy_nick_hint( ic, jid, name ); 379 } 376 380 } 377 381 else if( strcmp( sub, "remove" ) == 0 ) -
protocols/nogaim.c
r54f2f55 rd06eabf 428 428 { 429 429 user_t *u = user_findhandle( ic, handle ); 430 char *s, newnick[MAX_NICK_LENGTH+1];431 430 432 431 if( !u || !realname ) return; … … 440 439 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) ) 441 440 imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname ); 442 443 if( !u->online && !nick_saved( ic->acc, handle ) ) 444 { 445 /* Detect numeric handles: */ 446 for( s = u->user; isdigit( *s ); s++ ); 447 448 if( *s == 0 ) 449 { 450 /* If we reached the end of the string, it only contained numbers. 451 Seems to be an ICQ# then, so hopefully realname contains 452 something more useful. */ 453 strcpy( newnick, realname ); 454 455 /* Some processing to make sure this string is a valid IRC nickname. */ 456 nick_strip( newnick ); 457 if( set_getbool( &ic->irc->set, "lcnicks" ) ) 458 nick_lc( newnick ); 459 460 u->nick = g_strdup( newnick ); 461 } 462 } 463 } 464 } 465 441 } 442 } 443 444 /* Mainly meant for ICQ (and now also for Jabber conferences) to allow IM 445 modules to suggest a nickname for a handle. */ 446 void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ) 447 { 448 user_t *u = user_findhandle( ic, handle ); 449 char newnick[MAX_NICK_LENGTH+1]; 450 451 if( !u->online && !nick_saved( ic->acc, handle ) ) 452 { 453 /* Only do this if the person isn't online yet (which should 454 be the case if we just added it) and if the user hasn't 455 assigned a nickname to this buddy already. */ 456 457 strcpy( newnick, nick ); 458 459 /* Some processing to make sure this string is a valid IRC nickname. */ 460 nick_strip( newnick ); 461 if( set_getbool( &ic->irc->set, "lcnicks" ) ) 462 nick_lc( newnick ); 463 464 nick_dedupe( ic->acc, handle, newnick ); 465 466 u->nick = g_strdup( newnick ); 467 } 468 } 466 469 467 470 /* prpl.c */ -
protocols/nogaim.h
r54f2f55 rd06eabf 194 194 G_MODULE_EXPORT struct buddy *imcb_find_buddy( struct im_connection *ic, char *handle ); 195 195 G_MODULE_EXPORT void imcb_rename_buddy( struct im_connection *ic, char *handle, char *realname ); 196 G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ); 196 197 197 198 /* Buddy activity */ -
protocols/oscar/oscar.c
r54f2f55 rd06eabf 2022 2022 2023 2023 if (realname) { 2024 imcb_buddy_nick_hint(ic, curitem->name, realname); 2024 2025 imcb_rename_buddy(ic, curitem->name, realname); 2025 2026 g_free(realname);
Note: See TracChangeset
for help on using the changeset viewer.