diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-22 16:39:37 -0700 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-22 16:39:37 -0700 | 
| commit | 43671b964b636520a54e343542c5958b30e9f589 (patch) | |
| tree | c503e4eaa46677f964ebd588665cede72f96c1a8 /protocols/jabber/conference.c | |
| parent | e35d1a121d5fb2da3698fbe4a365fe38d0097665 (diff) | |
You can send messages too now. But it's still very kludgy and doesn't work
with anonymous rooms (ie about 95% of all available Jabber chatrooms?).
Diffstat (limited to 'protocols/jabber/conference.c')
| -rw-r--r-- | protocols/jabber/conference.c | 29 | 
1 files changed, 20 insertions, 9 deletions
| diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index ffc4f844..397fad85 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -61,6 +61,25 @@ struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *  	return c;  } +int jabber_chat_msg( struct groupchat *c, char *message, int flags ) +{ +	struct im_connection *ic = c->ic; +	struct jabber_chat *jc = c->data; +	struct xt_node *node; +	 +	node = xt_new_node( "body", message, NULL ); +	node = jabber_make_packet( "message", "groupchat", jc->name, node ); +	 +	if( !jabber_write_packet( ic, node ) ) +	{ +		xt_free_node( node ); +		return 0; +	} +	xt_free_node( node ); +	 +	return 1; +} +  int jabber_chat_leave( struct groupchat *c, const char *reason )  {  	struct im_connection *ic = c->ic; @@ -78,14 +97,6 @@ int jabber_chat_leave( struct groupchat *c, const char *reason )  	}  	xt_free_node( node ); -	/* Remove all participants from jc->buddies and clean up our data. */ -	jabber_buddy_remove_bare( ic, jc->name ); -	g_free( jc->name ); -	g_free( jc ); -	 -	/* And the generic stuff. */ -	imcb_chat_free( c ); -	  	return 1;  } @@ -187,7 +198,7 @@ void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud  	{  		s = strchr( bud->orig_jid, '/' );  		if( s ) *s = 0; -		imcb_chat_msg( chat, bud->orig_jid, body->text, 0, 0 ); +		imcb_chat_msg( chat, bud->orig_jid, body->text, 0, jabber_get_timestamp( node ) );  		if( s ) *s = '/';  	}  } | 
