aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-09 01:28:38 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-09 01:28:38 +0100
commit36577aa5efb2ef3daafd17f9ad179fedef28278e (patch)
treea92b56f013b1badb0d91f6444dedaa88ea3b0f23
parenteb37735451207895e7e1b5b3dcc0f9cbe178ad38 (diff)
Create the struct groupchat early on in msn_chat_with() so the new chat
setup method works properly.
-rw-r--r--protocols/msn/msn.c5
-rw-r--r--protocols/msn/sb.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c
index 85dd22ec..d6a4b158 100644
--- a/protocols/msn/msn.c
+++ b/protocols/msn/msn.c
@@ -222,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 ) ) )
{
@@ -239,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 )
diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c
index 641af5e7..626cc83e 100644
--- a/protocols/msn/sb.c
+++ b/protocols/msn/sb.c
@@ -236,7 +236,10 @@ struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb )
/* 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 )
+ sb->chat = bee_chat_by_title( ic->bee, ic, sb->who );
+ if( sb->chat == NULL )
+ sb->chat = imcb_chat_new( ic, buf );
/* Populate the channel. */
if( sb->who ) imcb_chat_add_buddy( sb->chat, sb->who );