diff options
Diffstat (limited to 'protocols/msn')
-rw-r--r-- | protocols/msn/Makefile | 2 | ||||
-rw-r--r-- | protocols/msn/msn.c | 9 | ||||
-rw-r--r-- | protocols/msn/msn_util.c | 3 | ||||
-rw-r--r-- | protocols/msn/sb.c | 24 |
4 files changed, 24 insertions, 14 deletions
diff --git a/protocols/msn/Makefile b/protocols/msn/Makefile index 1de755a8..6c59aedb 100644 --- a/protocols/msn/Makefile +++ b/protocols/msn/Makefile @@ -12,7 +12,7 @@ SRCDIR := $(SRCDIR)protocols/msn/ endif # [SH] Program variables -objects = invitation.o msn.o msn_util.o ns.o passport.o sb.o tables.o +objects = msn.o msn_util.o ns.o passport.o sb.o tables.o CFLAGS += -Wall LFLAGS += -r diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 0d67cc17..d6a4b158 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -78,9 +78,11 @@ static void msn_logout( struct im_connection *ic ) if( md ) { + /** Disabling MSN ft support for now. while( md->filetransfers ) { imcb_file_canceled( md->filetransfers->data, "Closing connection" ); } + */ if( md->fd >= 0 ) closesocket( md->fd ); @@ -220,6 +222,7 @@ static void msn_chat_leave( struct groupchat *c ) static struct groupchat *msn_chat_with( struct im_connection *ic, char *who ) { struct msn_switchboard *sb; + struct groupchat *c = imcb_chat_new( ic, who ); if( ( sb = msn_sb_by_handle( ic, who ) ) ) { @@ -237,10 +240,8 @@ static struct groupchat *msn_chat_with( struct im_connection *ic, char *who ) msn_sb_write_msg( ic, m ); - return NULL; + return c; } - - return NULL; } static void msn_keepalive( struct im_connection *ic ) @@ -331,7 +332,7 @@ void msn_initmodule() ret->rem_deny = msn_rem_deny; ret->send_typing = msn_send_typing; ret->handle_cmp = g_strcasecmp; - ret->transfer_request = msn_ftp_transfer_request; + //ret->transfer_request = msn_ftp_transfer_request; register_protocol(ret); } diff --git a/protocols/msn/msn_util.c b/protocols/msn/msn_util.c index 9c9d2720..a8d24b30 100644 --- a/protocols/msn/msn_util.c +++ b/protocols/msn/msn_util.c @@ -95,8 +95,7 @@ static void msn_buddy_ask_yes( void *data ) msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname ); - if( imcb_find_buddy( bla->ic, bla->handle ) == NULL ) - imcb_ask_add( bla->ic, bla->handle, NULL ); + imcb_ask_add( bla->ic, bla->handle, NULL ); g_free( bla->handle ); g_free( bla->realname ); diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 1614f69f..cb5789b8 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -174,14 +174,14 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ) buf = g_new0( char, i ); i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->acc->user ); } - else if( strncmp( text, MSN_INVITE_HEADERS, sizeof( MSN_INVITE_HEADERS ) - 1 ) == 0 ) + else if( strcmp( text, SB_KEEPALIVE_MESSAGE ) == 0 ) { - buf = g_strdup( text ); + buf = g_strdup( SB_KEEPALIVE_HEADERS ); i = strlen( buf ); } - else if( strcmp( text, SB_KEEPALIVE_MESSAGE ) == 0 ) + else if( strncmp( text, MSN_INVITE_HEADERS, sizeof( MSN_INVITE_HEADERS ) - 1 ) == 0 ) { - buf = g_strdup( SB_KEEPALIVE_HEADERS ); + buf = g_strdup( text ); i = strlen( buf ); } else @@ -232,11 +232,17 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ) struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb ) { struct im_connection *ic = sb->ic; + struct groupchat *c = NULL; char buf[1024]; /* Create the groupchat structure. */ g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); - sb->chat = imcb_chat_new( ic, buf ); + if( sb->who ) + c = bee_chat_by_title( ic->bee, ic, sb->who ); + if( c && !msn_sb_by_chat( c ) ) + sb->chat = c; + else + sb->chat = imcb_chat_new( ic, buf ); /* Populate the channel. */ if( sb->who ) imcb_chat_add_buddy( sb->chat, sb->who ); @@ -697,6 +703,8 @@ static int msn_sb_message( gpointer data, char *msg, int msglen, char **cmd, int /* PANIC! */ } } +#if 0 + // Disable MSN ft support for now. else if( g_strncasecmp( ct, "text/x-msmsgsinvite", 19 ) == 0 ) { char *command = msn_findheader( body, "Invitation-Command:", blen ); @@ -729,6 +737,7 @@ static int msn_sb_message( gpointer data, char *msg, int msglen, char **cmd, int g_free( command ); } +#endif else if( g_strncasecmp( ct, "application/x-msnmsgrp2p", 24 ) == 0 ) { imcb_error( sb->ic, "Cannot receive file from %s: BitlBee does not " @@ -764,10 +773,11 @@ static gboolean msn_sb_keepalive( gpointer data, gint source, b_input_condition void msn_sb_start_keepalives( struct msn_switchboard *sb, gboolean initial ) { - struct buddy *b; + bee_user_t *bu; if( sb && sb->who && sb->keepalive == 0 && - ( b = imcb_find_buddy( sb->ic, sb->who ) ) && !b->present && + ( bu = bee_user_by_handle( sb->ic->bee, sb->ic, sb->who ) ) && + !( bu->flags & BEE_USER_ONLINE ) && set_getbool( &sb->ic->acc->set, "switchboard_keepalives" ) ) { if( initial ) |