Changes in irc_send.c [e67e513:f01bc6f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_send.c
re67e513 rf01bc6f 110 110 } 111 111 112 const char *irc_user_msgdest( irc_user_t *iu ) 113 { 114 irc_t *irc = iu->irc; 112 void irc_usermsg( irc_t *irc, char *format, ... ) 113 { 115 114 irc_channel_t *ic = NULL; 116 115 irc_user_t *iu = irc->root; 116 char text[2048]; 117 va_list params; 118 char *dst; 119 120 va_start( params, format ); 121 g_vsnprintf( text, sizeof( text ), format, params ); 122 va_end( params ); 123 124 /* Too similar to bee_irc_user_msg()... */ 117 125 if( iu->last_channel ) 118 126 { … … 120 128 ic = iu->last_channel; 121 129 else 122 ic = irc_channel_with_user( irc, i u);130 ic = irc_channel_with_user( irc, irc->root ); 123 131 } 124 132 125 133 if( ic ) 126 returnic->name;134 dst = ic->name; 127 135 else 128 return irc->user->nick; 129 } 130 131 /* cmd = "PRIVMSG" or "NOTICE" */ 132 static void irc_usermsg_( const char *cmd, irc_user_t *iu, const char *format, va_list params ) 133 { 134 char text[2048]; 135 const char *dst; 136 137 g_vsnprintf( text, sizeof( text ), format, params ); 138 139 dst = irc_user_msgdest( iu ); 140 irc_send_msg( iu, cmd, dst, text, NULL ); 141 } 142 143 void irc_usermsg(irc_user_t *iu, char *format, ... ) 144 { 145 va_list params; 146 va_start( params, format ); 147 irc_usermsg_( "PRIVMSG", iu, format, params ); 148 va_end( params ); 149 } 150 151 void irc_usernotice(irc_user_t *iu, char *format, ... ) 152 { 153 va_list params; 154 va_start( params, format ); 155 irc_usermsg_( "NOTICE", iu, format, params ); 156 va_end( params ); 157 } 158 159 void irc_rootmsg( irc_t *irc, char *format, ... ) 160 { 161 va_list params; 162 va_start( params, format ); 163 irc_usermsg_( "PRIVMSG", irc->root, format, params ); 164 va_end( params ); 136 dst = irc->user->nick; 137 138 irc_send_msg( irc->root, "PRIVMSG", dst, text, NULL ); 165 139 } 166 140
Note: See TracChangeset
for help on using the changeset viewer.