Changeset 92c8d41
- Timestamp:
- 2010-06-26T21:26:41Z (14 years ago)
- Branches:
- master
- Children:
- e907683
- Parents:
- 41d415b
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r41d415b r92c8d41 66 66 struct irc_user *user; 67 67 68 char *last_root_cmd; 68 char *last_root_cmd; /* Either the nickname from which the last root 69 msg came, or the last channel root was talked 70 to. */ 69 71 70 72 char *password; /* HACK: Used to save the user's password, but before … … 80 82 struct irc_channel *default_channel; 81 83 GHashTable *nick_user_hash; 82 GHashTable *watches; 84 GHashTable *watches; /* See irc_cmd_watch() */ 83 85 84 86 gint r_watch_source_id; … … 91 93 typedef enum 92 94 { 93 IRC_USER_PRIVATE = 1,95 /* Replaced with iu->last_channel IRC_USER_PRIVATE = 1, */ 94 96 IRC_USER_AWAY = 2, 95 97 } irc_user_flags_t; … … 108 110 109 111 irc_user_flags_t flags; 112 struct irc_channel *last_channel; 110 113 111 114 GString *pastebuf; /* Paste buffer (combine lines into a multiline msg). */ -
irc_channel.c
r41d415b r92c8d41 375 375 if( iu && iu->f->privmsg ) 376 376 { 377 iu-> flags &= ~IRC_USER_PRIVATE;377 iu->last_channel = ic; 378 378 iu->f->privmsg( iu, s ); 379 379 } -
irc_commands.c
r41d415b r92c8d41 306 306 else if( iu->f->privmsg ) 307 307 { 308 iu-> flags |= IRC_USER_PRIVATE;308 iu->last_channel = NULL; 309 309 iu->f->privmsg( iu, cmd[2] ); 310 310 } -
irc_im.c
r41d415b r92c8d41 34 34 { 35 35 irc_user_t *iu; 36 irc_t *irc = (irc_t*) bee->ui_data; 36 37 char nick[MAX_NICK_LENGTH+1], *s; 37 38 … … 39 40 strcpy( nick, nick_get( bu->ic->acc, bu->handle ) ); 40 41 41 bu->ui_data = iu = irc_user_new( (irc_t*) bee->ui_data, nick );42 bu->ui_data = iu = irc_user_new( irc, nick ); 42 43 iu->bu = bu; 43 44 … … 63 64 } 64 65 65 if( set_getbool( &bee->set, "private" ) )66 iu->flags |= IRC_USER_PRIVATE;67 68 66 if( bu->flags & BEE_USER_LOCAL ) 69 67 { … … 71 69 72 70 if( strcmp( s, "add_private" ) == 0 ) 73 iu-> flags |= IRC_USER_PRIVATE;71 iu->last_channel = NULL; 74 72 else if( strcmp( s, "add_channel" ) == 0 ) 75 iu-> flags &= ~IRC_USER_PRIVATE;73 iu->last_channel = irc->default_channel; 76 74 } 77 75 78 76 iu->f = &irc_user_im_funcs; 79 //iu->last_typing_notice = 0;80 77 81 78 return TRUE; … … 180 177 { 181 178 irc_t *irc = bee->ui_data; 182 irc_channel_t *ic = irc->default_channel;183 179 irc_user_t *iu = (irc_user_t *) bu->ui_data; 184 180 char *dst, *prefix = NULL; … … 188 184 ts = irc_format_timestamp( irc, sent_at ); 189 185 190 if( iu->flags & IRC_USER_PRIVATE ) 186 if( iu->last_channel ) 187 { 188 dst = iu->last_channel->name; 189 prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" ); 190 } 191 else 191 192 { 192 193 dst = irc->user->nick; 193 194 prefix = ts; 194 195 ts = NULL; 195 }196 else197 {198 dst = ic->name;199 prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" );200 196 } 201 197 -
irc_user.c
r41d415b r92c8d41 34 34 iu->user = iu->host = iu->fullname = iu->nick; 35 35 36 iu->flags = set_getbool( &irc->b->set, "private" ) ? IRC_USER_PRIVATE : 0; 36 if( set_getbool( &irc->b->set, "private" ) ) 37 iu->last_channel = NULL; 38 else 39 iu->last_channel = irc->default_channel; 37 40 38 41 iu->key = g_strdup( nick );
Note: See TracChangeset
for help on using the changeset viewer.