Changeset 1d39159
- Timestamp:
- 2010-04-05T00:18:24Z (15 years ago)
- Branches:
- master
- Children:
- 0b5cc72
- Parents:
- f012a9f
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
rf012a9f r1d39159 120 120 } 121 121 122 static gboolean bee_irc_user_fullname( bee_t *bee, bee_user_t *bu ) 123 { 124 irc_user_t *iu = (irc_user_t *) bu->ui_data; 125 irc_t *irc = (irc_t *) bee->ui_data; 126 char *s; 127 128 if( iu->fullname != iu->nick ) 129 g_free( iu->fullname ); 130 iu->fullname = g_strdup( bu->fullname ); 131 132 /* Strip newlines (unlikely, but IRC-unfriendly so they must go) 133 TODO(wilmer): Do the same with away msgs again! */ 134 for( s = iu->fullname; *s; s ++ ) 135 if( isspace( *s ) ) *s = ' '; 136 137 if( ( bu->ic->flags & OPT_LOGGED_IN ) && set_getbool( &bee->set, "display_namechanges" ) ) 138 { 139 char *msg = g_strdup_printf( "<< \002BitlBee\002 - Changed name to `%s' >>", iu->fullname ); 140 irc_send_msg( iu, "NOTICE", irc->user->nick, msg, NULL ); 141 } 142 143 s = set_getstr( &bu->ic->acc->set, "nick_source" ); 144 if( strcmp( s, "handle" ) != 0 ) 145 { 146 char *name = g_strdup( bu->fullname ); 147 148 if( strcmp( s, "first_name" ) == 0 ) 149 { 150 int i; 151 for( i = 0; name[i] && !isspace( name[i] ); i ++ ) {} 152 name[i] = '\0'; 153 } 154 155 imcb_buddy_nick_hint( bu->ic, bu->handle, name ); 156 157 g_free( name ); 158 } 159 160 return TRUE; 161 } 162 122 163 const struct bee_ui_funcs irc_ui_funcs = { 123 164 bee_irc_user_new, 124 165 bee_irc_user_free, 166 bee_irc_user_fullname, 125 167 bee_irc_user_status, 126 168 bee_irc_user_msg, -
irc_send.c
rf012a9f r1d39159 220 220 iu->nick, iu->user, iu->host, iu->fullname ); 221 221 222 /* 223 if( u->ic ) 224 irc_send_num( irc, 312, "%s %s.%s :%s network", u->nick, u->ic->acc->user, 225 u->ic->acc->server && *u->ic->acc->server ? u->ic->acc->server : "", 226 u->ic->acc->prpl->name ); 222 if( iu->bu ) 223 { 224 bee_user_t *bu = iu->bu; 225 226 irc_send_num( irc, 312, "%s %s.%s :%s network", iu->nick, bu->ic->acc->user, 227 bu->ic->acc->server && *bu->ic->acc->server ? bu->ic->acc->server : "", 228 bu->ic->acc->prpl->name ); 229 230 if( bu->status ) 231 { 232 if( bu->status_msg ) 233 irc_send_num( irc, 301, "%s :%s (%s)", iu->nick, bu->status, bu->status_msg ); 234 else 235 irc_send_num( irc, 301, "%s :%s", iu->nick, bu->status ); 236 } 237 238 /* 239 if( u->status_msg ) 240 irc_send_num( irc, 333, "%s :Status: %s", u->nick, u->status_msg ); 241 */ 242 } 227 243 else 228 irc_send_num( irc, 312, "%s %s :%s", u->nick, irc->myhost, IRCD_INFO ); 229 */ 230 231 /* 232 if( u->away ) 233 irc_send_num( irc, 301, "%s :%s", u->nick, u->away ); 234 if( u->status_msg ) 235 irc_send_num( irc, 333, "%s :Status: %s", u->nick, u->status_msg ); 236 */ 244 { 245 irc_send_num( irc, 312, "%s %s :%s", iu->nick, irc->root->host, IRCD_INFO " " BITLBEE_VERSION ); 246 } 237 247 238 248 irc_send_num( irc, 318, "%s :End of /WHOIS list", iu->nick ); -
protocols/bee.h
rf012a9f r1d39159 68 68 gboolean (*user_new)( bee_t *bee, struct bee_user *bu ); 69 69 gboolean (*user_free)( bee_t *bee, struct bee_user *bu ); 70 gboolean (*user_fullname)( bee_t *bee, bee_user_t *bu ); 70 71 gboolean (*user_status)( bee_t *bee, struct bee_user *bu, struct bee_user *old ); 71 72 gboolean (*user_msg)( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at ); -
protocols/bee_user.c
rf012a9f r1d39159 169 169 { 170 170 bee_t *bee = ic->bee; 171 char *wrapped;172 171 bee_user_t *bu; 173 172 -
protocols/nogaim.c
rf012a9f r1d39159 365 365 { 366 366 bee_user_t *bu; 367 //char nick[MAX_NICK_LENGTH+1], *s;368 367 bee_t *bee = ic->bee; 369 368 … … 385 384 } 386 385 387 void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *realname ) 388 { 389 #if 0 390 user_t *u = user_findhandle( ic, handle ); 391 char *set; 392 393 if( !u || !realname ) return; 394 395 if( g_strcasecmp( u->realname, realname ) != 0 ) 396 { 397 if( u->realname != u->nick ) g_free( u->realname ); 398 399 u->realname = g_strdup( realname ); 400 401 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->bee->set, "display_namechanges" ) ) 402 imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname ); 403 } 404 405 set = set_getstr( &ic->acc->set, "nick_source" ); 406 if( strcmp( set, "handle" ) != 0 ) 407 { 408 char *name = g_strdup( realname ); 409 410 if( strcmp( set, "first_name" ) == 0 ) 411 { 412 int i; 413 for( i = 0; name[i] && !isspace( name[i] ); i ++ ) {} 414 name[i] = '\0'; 415 } 416 417 imcb_buddy_nick_hint( ic, handle, name ); 418 419 g_free( name ); 420 } 421 #endif 386 void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *fullname ) 387 { 388 bee_t *bee = ic->bee; 389 bee_user_t *bu = bee_user_by_handle( bee, ic, handle ); 390 391 if( !bu || !fullname ) return; 392 393 if( strcmp( bu->fullname, fullname ) != 0 ) 394 { 395 g_free( bu->fullname ); 396 bu->fullname = g_strdup( fullname ); 397 398 if( bee->ui->user_fullname ) 399 bee->ui->user_fullname( bee, bu ); 400 } 422 401 } 423 402
Note: See TracChangeset
for help on using the changeset viewer.