- Timestamp:
- 2010-05-08T00:25:15Z (15 years ago)
- Branches:
- master
- Children:
- b17ce85
- Parents:
- f1a0890
- Location:
- protocols
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee.h
rf1a0890 r27e2c66 81 81 gboolean (*chat_new)( bee_t *bee, struct groupchat *c ); 82 82 gboolean (*chat_free)( bee_t *bee, struct groupchat *c ); 83 gboolean (*chat_log)( bee_t *bee, struct groupchat *c, const char * format, ...);84 gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, const char *who, const char *msg, time_t sent_at );83 gboolean (*chat_log)( bee_t *bee, struct groupchat *c, const char *text ); 84 gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at ); 85 85 gboolean (*chat_add_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); 86 86 gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); -
protocols/bee_chat.c
rf1a0890 r27e2c66 105 105 void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at ) 106 106 { 107 #if 0 108 struct im_connection *ic = c->ic;109 char *wrapped;110 user_t *u;107 struct im_connection *ic = c->ic; 108 bee_t *bee = ic->bee; 109 bee_user_t *bu; 110 char *s; 111 111 112 112 /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */ … … 114 114 return; 115 115 116 u = user_findhandle( ic, who ); 117 118 if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) || 119 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) ) 116 bu = bee_user_by_handle( bee, ic, who ); 117 118 s = set_getstr( &ic->bee->set, "strip_html" ); 119 if( ( g_strcasecmp( s, "always" ) == 0 ) || 120 ( ( ic->flags & OPT_DOES_HTML ) && s ) ) 120 121 strip_html( msg ); 121 122 122 wrapped = word_wrap( msg, 425 ); 123 if( c && u ) 124 { 125 char *ts = NULL; 126 if( set_getbool( &ic->irc->set, "display_timestamps" ) ) 127 ts = format_timestamp( ic->irc, sent_at ); 128 irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, ts ? : "", wrapped ); 129 g_free( ts ); 130 } 123 if( bu && bee->ui->chat_msg ) 124 bee->ui->chat_msg( bee, c, bu, msg, sent_at ); 131 125 else 132 { 133 imcb_log( ic, "Message from/to conversation %s@%p (unknown conv/user): %s", who, c, wrapped ); 134 } 135 g_free( wrapped ); 136 #endif 126 imcb_chat_log( c, "Message from unknown participant %s: %s", who, msg ); 137 127 } 138 128 139 129 void imcb_chat_log( struct groupchat *c, char *format, ... ) 140 130 { 141 #if 0 142 irc_t *irc = c->ic->irc;131 struct im_connection *ic = c->ic; 132 bee_t *bee = ic->bee; 143 133 va_list params; 144 134 char *text; 145 user_t *u; 135 136 if( !bee->ui->chat_log ) 137 return; 146 138 147 139 va_start( params, format ); … … 149 141 va_end( params ); 150 142 151 u = user_find( irc, irc->mynick ); 152 153 irc_privmsg( irc, u, "PRIVMSG", c->channel, "System message: ", text ); 154 143 bee->ui->chat_log( bee, c, text ); 155 144 g_free( text ); 156 #endif157 145 } 158 146
Note: See TracChangeset
for help on using the changeset viewer.