From 52744f8f65a278a59a8903d5c594e057d63c7006 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 17 Jan 2008 22:06:55 +0000 Subject: Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts for pid_t variables). --- protocols/nogaim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 5e698902..b9008af1 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -624,7 +624,7 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, } } -void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_t flags, time_t sent_at ) +void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t flags, time_t sent_at ) { irc_t *irc = ic->irc; char *wrapped; @@ -675,7 +675,7 @@ void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_ g_free( wrapped ); } -void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags ) +void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags ) { user_t *u; @@ -731,7 +731,7 @@ void imcb_chat_free( struct groupchat *c ) } } -void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at ) +void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at ) { struct im_connection *ic = c->ic; char *wrapped; -- cgit v1.2.3 From 83ba3e541acc3c29616fbf982b57633d303d941a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 18 Jan 2008 13:20:37 +0000 Subject: Moving imcb_chat_new() to a saner location (no code changes) and fixing default channel topic. --- protocols/nogaim.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index b9008af1..cfdaa454 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -691,6 +691,31 @@ void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags ) } } +struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle ) +{ + struct groupchat *c; + + /* This one just creates the conversation structure, user won't see anything yet */ + + if( ic->groupchats ) + { + for( c = ic->groupchats; c->next; c = c->next ); + c = c->next = g_new0( struct groupchat, 1 ); + } + else + ic->groupchats = c = g_new0( struct groupchat, 1 ); + + c->ic = ic; + c->title = g_strdup( handle ); + c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ ); + c->topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title ); + + if( set_getbool( &ic->irc->set, "debug" ) ) + imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle ); + + return c; +} + void imcb_chat_free( struct groupchat *c ) { struct im_connection *ic = c->ic; @@ -727,6 +752,7 @@ void imcb_chat_free( struct groupchat *c ) g_list_free( c->in_room ); g_free( c->channel ); g_free( c->title ); + g_free( c->topic ); g_free( c ); } } @@ -782,31 +808,6 @@ void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at irc_write( ic->irc, ":%s!%s@%s TOPIC %s :%s", u->nick, u->user, u->host, c->channel, topic ); } -struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle ) -{ - struct groupchat *c; - - /* This one just creates the conversation structure, user won't see anything yet */ - - if( ic->groupchats ) - { - for( c = ic->groupchats; c->next; c = c->next ); - c = c->next = g_new0( struct groupchat, 1 ); - } - else - ic->groupchats = c = g_new0( struct groupchat, 1 ); - - c->ic = ic; - c->title = g_strdup( handle ); - c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ ); - c->topic = g_strdup_printf( "%s :BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->channel, c->title ); - - if( set_getbool( &ic->irc->set, "debug" ) ) - imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle ); - - return c; -} - /* buddy_chat.c */ -- cgit v1.2.3 From 31e584652a5543b87e0953525a742fb067c28e6f Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 20 Jan 2008 00:17:57 +0000 Subject: Added imcb_chat_log() for chatroom system messages, so they can be displayed inside the right channel. --- protocols/nogaim.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index cfdaa454..3ce15166 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -785,6 +785,24 @@ void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, t g_free( wrapped ); } +void imcb_chat_log( struct groupchat *c, char *format, ... ) +{ + irc_t *irc = c->ic->irc; + va_list params; + char *text; + user_t *u; + + va_start( params, format ); + text = g_strdup_vprintf( format, params ); + va_end( params ); + + u = user_find( irc, irc->mynick ); + + irc_privmsg( irc, u, "PRIVMSG", c->channel, "System message: ", text ); + + g_free( text ); +} + void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at ) { struct im_connection *ic = c->ic; -- cgit v1.2.3