Changes in irc_send.c [f01bc6f:e67e513]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_send.c
rf01bc6f re67e513 110 110 } 111 111 112 void irc_usermsg( irc_t *irc, char *format, ... ) 113 { 112 const char *irc_user_msgdest( irc_user_t *iu ) 113 { 114 irc_t *irc = iu->irc; 114 115 irc_channel_t *ic = NULL; 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()... */ 116 125 117 if( iu->last_channel ) 126 118 { … … 128 120 ic = iu->last_channel; 129 121 else 130 ic = irc_channel_with_user( irc, i rc->root);122 ic = irc_channel_with_user( irc, iu ); 131 123 } 132 124 133 125 if( ic ) 134 dst =ic->name;126 return ic->name; 135 127 else 136 dst = irc->user->nick; 137 138 irc_send_msg( irc->root, "PRIVMSG", dst, text, NULL ); 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 ); 139 165 } 140 166
Note: See TracChangeset
for help on using the changeset viewer.