- Timestamp:
- 2010-04-02T03:25:41Z (15 years ago)
- Branches:
- master
- Children:
- 1d39159
- Parents:
- 231b08b
- Location:
- protocols
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee.h
r231b08b rf012a9f 69 69 gboolean (*user_free)( bee_t *bee, struct bee_user *bu ); 70 70 gboolean (*user_status)( bee_t *bee, struct bee_user *bu, struct bee_user *old ); 71 gboolean (*user_msg)( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at ); 71 72 } bee_ui_funcs_t; 72 73 -
protocols/bee_user.c
r231b08b rf012a9f 116 116 else 117 117 { 118 if( set_getbool( &ic->bee->set, "debug" ) ||g_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "ignore" ) != 0 )118 if( g_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "ignore" ) != 0 ) 119 119 { 120 imcb_log( ic, "imcb_buddy_status() for unknown handle %s: ", handle );121 imcb_log( ic, "flags = %d, state = %s, message = %s", flags,122 state ? state : "NULL", message ? message : "NULL" );120 imcb_log( ic, "imcb_buddy_status() for unknown handle %s:\n" 121 "flags = %d, state = %s, message = %s", handle, flags, 122 state ? state : "NULL", message ? message : "NULL" ); 123 123 } 124 124 … … 142 142 g_free( old ); 143 143 #if 0 144 oa = u->away != NULL;145 oo = u->online;146 147 g_free( u->away );148 g_free( u->status_msg );149 u->away = u->status_msg = NULL;150 151 if( ( flags & OPT_LOGGED_IN ) && !u->online )152 {153 irc_spawn( ic->irc, u );154 u->online = 1;155 }156 else if( !( flags & OPT_LOGGED_IN ) && u->online )157 {158 struct groupchat *c;159 160 irc_kill( ic->irc, u );161 u->online = 0;162 163 /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */164 for( c = ic->groupchats; c; c = c->next )165 remove_chat_buddy_silent( c, handle );166 }167 168 if( flags & OPT_AWAY )169 {170 if( state && message )171 {172 u->away = g_strdup_printf( "%s (%s)", state, message );173 }174 else if( state )175 {176 u->away = g_strdup( state );177 }178 else if( message )179 {180 u->away = g_strdup( message );181 }182 else183 {184 u->away = g_strdup( "Away" );185 }186 }187 else188 {189 u->status_msg = g_strdup( message );190 }191 192 144 /* LISPy... */ 193 145 if( ( set_getbool( &ic->bee->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ … … 216 168 void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at ) 217 169 { 218 #if 0219 170 bee_t *bee = ic->bee; 220 171 char *wrapped; 221 user_t *u;172 bee_user_t *bu; 222 173 223 u = user_findhandle(ic, handle );174 bu = bee_user_by_handle( bee, ic, handle ); 224 175 225 if( ! u )176 if( !bu ) 226 177 { 227 178 char *h = set_getstr( &bee->set, "handle_unknown" ); … … 229 180 if( g_strcasecmp( h, "ignore" ) == 0 ) 230 181 { 231 if( set_getbool( &bee->set, "debug" ) )232 imcb_log( ic, "Ignoring message from unknown handle %s", handle );233 234 182 return; 235 183 } 236 184 else if( g_strncasecmp( h, "add", 3 ) == 0 ) 237 185 { 238 int private = set_getbool( &bee->set, "private" ); 239 240 if( h[3] ) 241 { 242 if( g_strcasecmp( h + 3, "_private" ) == 0 ) 243 private = 1; 244 else if( g_strcasecmp( h + 3, "_channel" ) == 0 ) 245 private = 0; 246 } 247 248 imcb_add_buddy( ic, handle, NULL ); 249 u = user_findhandle( ic, handle ); 250 u->is_private = private; 251 } 252 else 253 { 254 imcb_log( ic, "Message from unknown handle %s:", handle ); 255 u = user_find( irc, irc->mynick ); 186 bu = bee_user_new( bee, ic, handle ); 256 187 } 257 188 } … … 260 191 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) ) 261 192 strip_html( msg ); 262 263 wrapped = word_wrap( msg, 425 );264 irc_msgfrom( irc, u->nick, wrapped);265 g_free( wrapped );266 #endif 193 194 if( bee->ui->user_msg && bu ) 195 bee->ui->user_msg( bee, bu, msg, sent_at ); 196 else 197 imcb_log( ic, "Message from unknown handle %s:\n%s", handle, msg ); 267 198 }
Note: See TracChangeset
for help on using the changeset viewer.