Changeset f7ca587 for irc_send.c
- Timestamp:
- 2010-07-29T18:18:54Z (14 years ago)
- Branches:
- master
- Children:
- 1521a85
- Parents:
- 2fe5eb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_send.c
r2fe5eb9 rf7ca587 104 104 void irc_usermsg( irc_t *irc, char *format, ... ) 105 105 { 106 irc_channel_t *ic ;107 irc_user_t *iu ;106 irc_channel_t *ic = NULL; 107 irc_user_t *iu = irc->root; 108 108 char text[1024]; 109 109 va_list params; 110 char *dst; 110 111 111 112 va_start( params, format ); … … 113 114 va_end( params ); 114 115 115 if( irc->last_root_cmd && 116 irc_channel_name_ok( irc->last_root_cmd ) && 117 ( ic = irc_channel_by_name( irc, irc->last_root_cmd ) ) && 118 ic->flags & IRC_CHANNEL_JOINED ) 119 irc_send_msg( irc->root, "PRIVMSG", irc->last_root_cmd, text, NULL ); 120 else if( irc->last_root_cmd && 121 ( iu = irc_user_by_name( irc, irc->last_root_cmd ) ) && 122 iu->f == &irc_user_root_funcs ) 123 irc_send_msg( iu, "PRIVMSG", irc->user->nick, text, NULL ); 124 else 125 { 126 g_free( irc->last_root_cmd ); 127 irc->last_root_cmd = NULL; 128 129 irc_send_msg( irc->root, "PRIVMSG", irc->user->nick, text, NULL ); 130 } 131 132 /*return( irc_msgfrom( irc, u->nick, text ) );*/ 116 /* Too similar to bee_irc_user_msg()... */ 117 if( iu->last_channel ) 118 { 119 if( iu->last_channel->flags & IRC_CHANNEL_JOINED ) 120 ic = iu->last_channel; 121 else if( irc->default_channel->flags & IRC_CHANNEL_JOINED ) 122 ic = irc->default_channel; 123 } 124 125 if( ic ) 126 dst = ic->name; 127 else 128 dst = irc->user->nick; 129 130 irc_send_msg( irc->root, "PRIVMSG", dst, text, NULL ); 133 131 } 134 132
Note: See TracChangeset
for help on using the changeset viewer.