Moved setting presence status and show into functions

This commit is contained in:
James Booth
2013-02-04 02:19:31 +00:00
parent eb26cab739
commit b94dc5ecdd
3 changed files with 58 additions and 63 deletions

View File

@@ -123,7 +123,9 @@ presence_update(jabber_presence_t presence_type, const char * const msg,
connection_set_presence_message(msg);
connection_set_priority(pri);
xmpp_stanza_t *presence = stanza_create_presence(ctx, show, msg);
xmpp_stanza_t *presence = stanza_create_presence(ctx);
stanza_attach_show(ctx, presence, show);
stanza_attach_status(ctx, presence, msg);
stanza_attach_priority(ctx, presence, pri);
stanza_attach_last_activity(ctx, presence, idle);
stanza_attach_caps(ctx, presence);
@@ -165,7 +167,9 @@ presence_join_room(Jid *jid)
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
presence_type);
xmpp_stanza_t *presence = stanza_create_room_join_presence(ctx, jid->fulljid, show, status);
xmpp_stanza_t *presence = stanza_create_room_join_presence(ctx, jid->fulljid);
stanza_attach_show(ctx, presence, show);
stanza_attach_status(ctx, presence, status);
stanza_attach_priority(ctx, presence, pri);
stanza_attach_caps(ctx, presence);