aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/sb.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/msn/sb.c')
-rw-r--r--protocols/msn/sb.c24
1 files changed, 17 insertions, 7 deletions
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 )