diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/bee.h | 1 | ||||
-rw-r--r-- | protocols/bee_chat.c | 54 |
2 files changed, 5 insertions, 50 deletions
diff --git a/protocols/bee.h b/protocols/bee.h index 982bb914..c1b95881 100644 --- a/protocols/bee.h +++ b/protocols/bee.h @@ -84,6 +84,7 @@ typedef struct bee_ui_funcs gboolean (*chat_msg)( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at ); gboolean (*chat_add_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu ); + gboolean (*chat_name_hint)( bee_t *bee, struct groupchat *c, const char *name ); struct file_transfer* (*ft_in_start)( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size ); gboolean (*ft_out_start)( struct im_connection *ic, struct file_transfer *ft ); diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c index b523e544..36e4c453 100644 --- a/protocols/bee_chat.c +++ b/protocols/bee_chat.c @@ -51,33 +51,10 @@ struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) void imcb_chat_name_hint( struct groupchat *c, const char *name ) { -#if 0 - if( !c->joined ) - { - struct im_connection *ic = c->ic; - char stripped[MAX_NICK_LENGTH+1], *full_name; - - strncpy( stripped, name, MAX_NICK_LENGTH ); - stripped[MAX_NICK_LENGTH] = '\0'; - nick_strip( stripped ); - if( set_getbool( &ic->irc->set, "lcnicks" ) ) - nick_lc( stripped ); - - full_name = g_strdup_printf( "&%s", stripped ); - - if( stripped[0] && - nick_cmp( stripped, ic->irc->channel + 1 ) != 0 && - irc_chat_by_channel( ic->irc, full_name ) == NULL ) - { - g_free( c->channel ); - c->channel = full_name; - } - else - { - g_free( full_name ); - } - } -#endif + bee_t *bee = c->ic->bee; + + if( bee->ui->chat_name_hint ) + bee->ui->chat_name_hint( bee, c, name ); } void imcb_chat_free( struct groupchat *c ) @@ -224,29 +201,6 @@ void imcb_chat_remove_buddy( struct groupchat *c, const char *handle, const char bee->ui->chat_remove_user( bee, c, bu ); } -#if 0 -static int remove_chat_buddy_silent( struct groupchat *b, const char *handle ) -{ - GList *i; - - /* Find the handle in the room userlist and shoot it */ - i = b->in_room; - while( i ) - { - if( g_strcasecmp( handle, i->data ) == 0 ) - { - g_free( i->data ); - b->in_room = g_list_remove( b->in_room, i->data ); - return( 1 ); - } - - i = i->next; - } - - return 0; -} -#endif - int bee_chat_msg( bee_t *bee, struct groupchat *c, const char *msg, int flags ) { struct im_connection *ic = c->ic; |