From 226fce105c1189bde1aa321b494494d49b463e90 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 09:45:14 +0200 Subject: Some changes for im_api. (bim_* functions) --- irc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 3cdd03cb..2d35bbb6 100644 --- a/irc.c +++ b/irc.c @@ -1010,7 +1010,7 @@ int irc_send( irc_t *irc, char *nick, char *s, int flags ) } else if( c && c->gc && c->gc->prpl ) { - return( serv_send_chat( irc, c->gc, c->id, s ) ); + return( bim_chat_msg( c->gc, c->id, s ) ); } return( 0 ); @@ -1020,8 +1020,12 @@ gboolean buddy_send_handler_delayed( gpointer data ) { user_t *u = data; + /* Shouldn't happen, but just to be sure. */ + if( u->sendbuf_len < 2 ) + return FALSE; + u->sendbuf[u->sendbuf_len-2] = 0; /* Cut off the last newline */ - serv_send_im( u->gc->irc, u, u->sendbuf, u->sendbuf_flags ); + bim_buddy_msg( u->gc, u->handle, u->sendbuf, u->sendbuf_flags ); g_free( u->sendbuf ); u->sendbuf = NULL; @@ -1029,7 +1033,7 @@ gboolean buddy_send_handler_delayed( gpointer data ) u->sendbuf_timer = 0; u->sendbuf_flags = 0; - return( FALSE ); + return FALSE; } void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) @@ -1042,7 +1046,7 @@ void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) if( u->sendbuf_len > 0 && u->sendbuf_flags != flags) { - //Flush the buffer + /* Flush the buffer */ g_source_remove( u->sendbuf_timer ); buddy_send_handler_delayed( u ); } @@ -1050,14 +1054,14 @@ void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) if( u->sendbuf_len == 0 ) { u->sendbuf_len = strlen( msg ) + 2; - u->sendbuf = g_new (char, u->sendbuf_len ); + u->sendbuf = g_new( char, u->sendbuf_len ); u->sendbuf[0] = 0; u->sendbuf_flags = flags; } else { u->sendbuf_len += strlen( msg ) + 1; - u->sendbuf = g_renew ( char, u->sendbuf, u->sendbuf_len ); + u->sendbuf = g_renew( char, u->sendbuf, u->sendbuf_len ); } strcat( u->sendbuf, msg ); @@ -1073,7 +1077,7 @@ void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) } else { - serv_send_im( irc, u, msg, flags ); + bim_buddy_msg( u->gc, u->handle, msg, flags ); } } -- cgit v1.2.3 From fc630f9fb47690c30feaf4738727a213d633afc9 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 23 May 2006 10:31:04 +0200 Subject: Silenced all compiler warnings that appeared after previous commit. --- irc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 2d35bbb6..fb85de62 100644 --- a/irc.c +++ b/irc.c @@ -829,7 +829,7 @@ void irc_topic( irc_t *irc, char *channel ) if( c ) irc_reply( irc, 332, "%s :BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", channel, c->title ); else - irc_reply( irc, 331, "%s :No topic for this channel" ); + irc_reply( irc, 331, "%s :No topic for this channel", channel ); } } @@ -885,7 +885,7 @@ void irc_join( irc_t *irc, user_t *u, char *channel ) nick_lc( nick ); if( g_hash_table_lookup( irc->watches, nick ) ) { - irc_reply( irc, 600, "%s %s %s %d :%s", u->nick, u->user, u->host, time( NULL ), "logged online" ); + irc_reply( irc, 600, "%s %s %s %d :%s", u->nick, u->user, u->host, (int) time( NULL ), "logged online" ); } g_free( nick ); } @@ -910,7 +910,7 @@ void irc_kill( irc_t *irc, user_t *u ) nick_lc( nick ); if( g_hash_table_lookup( irc->watches, nick ) ) { - irc_reply( irc, 601, "%s %s %s %d :%s", u->nick, u->user, u->host, time( NULL ), "logged offline" ); + irc_reply( irc, 601, "%s %s %s %d :%s", u->nick, u->user, u->host, (int) time( NULL ), "logged offline" ); } g_free( nick ); } -- cgit v1.2.3