Changes in irc_im.c [e67e513:5f74987]
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
re67e513 r5f74987 193 193 } 194 194 195 static void bee_irc_msg_from_user( irc_user_t *iu, const char *msg, time_t sent_at ) 196 { 197 irc_t *irc = iu->irc; 198 bee_t *bee = irc->b; 199 const char *dst; 200 char *prefix = NULL; 195 static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg_, time_t sent_at ) 196 { 197 irc_t *irc = bee->ui_data; 198 irc_user_t *iu = (irc_user_t *) bu->ui_data; 199 char *dst, *prefix = NULL; 201 200 char *wrapped, *ts = NULL; 202 201 irc_channel_t *ic = NULL; 202 char *msg = g_strdup( msg_ ); 203 GSList *l; 204 203 205 if( sent_at > 0 && set_getbool( &irc->b->set, "display_timestamps" ) ) 204 206 ts = irc_format_timestamp( irc, sent_at ); 205 207 206 dst = irc_user_msgdest(iu); 207 if(dst != irc->user->nick) { 208 /* if not messaging directly, call user by name */ 208 /* Too similar to irc_usermsg()... */ 209 if( iu->last_channel ) 210 { 211 if( iu->last_channel->flags & IRC_CHANNEL_JOINED ) 212 ic = iu->last_channel; 213 else 214 ic = irc_channel_with_user( irc, iu ); 215 } 216 217 if( ic ) 218 { 219 dst = ic->name; 209 220 prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" ); 210 } else { 221 } 222 else 223 { 224 dst = irc->user->nick; 211 225 prefix = ts; 212 ts = NULL; /* don't doulbe-free */ 213 } 214 215 wrapped = word_wrap( msg, 425 ); 216 irc_send_msg( iu, "PRIVMSG", dst, wrapped, prefix ); 217 218 g_free( wrapped ); 219 g_free( prefix ); 220 g_free( ts ); 221 } 222 223 static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg_, time_t sent_at ) 224 { 225 irc_user_t *iu = (irc_user_t *) bu->ui_data; 226 char *msg = g_strdup( msg_ ); 227 GSList *l; 226 ts = NULL; 227 } 228 228 229 229 for( l = irc_plugins; l; l = l->next ) … … 256 256 } 257 257 258 bee_irc_msg_from_user( iu, msg, sent_at ); 259 258 wrapped = word_wrap( msg, 425 ); 259 irc_send_msg( iu, "PRIVMSG", dst, wrapped, prefix ); 260 261 g_free( wrapped ); 262 g_free( prefix ); 260 263 g_free( msg ); 264 g_free( ts ); 265 261 266 return TRUE; 262 267 } … … 988 993 else if( !acc->prpl->chat_join ) 989 994 { 990 irc_ rootmsg( ic->irc, "Named chatrooms not supported on that account." );995 irc_usermsg( ic->irc, "Named chatrooms not supported on that account." ); 991 996 return SET_INVALID; 992 997 }
Note: See TracChangeset
for help on using the changeset viewer.