about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-08-20 20:37:48 +0100
committerJames Booth <boothj5@gmail.com>2016-08-20 20:37:48 +0100
commit583fb2b8c66d1af9059763b2f8f56b7f78da246a (patch)
tree424cf3e5e56b991d7ac400796925e80e1785846e /src/xmpp/stanza.c
parent27263508c769474f26010ba638872a027d229020 (diff)
downloadprofani-tty-583fb2b8c66d1af9059763b2f8f56b7f78da246a.tar.gz
Use libstrophe xmpp_presence_new convenience function
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index 4dd8c526..bf4e44e1 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -554,8 +554,7 @@ xmpp_stanza_t*
 stanza_create_room_join_presence(xmpp_ctx_t *const ctx,
     const char *const full_room_jid, const char *const passwd)
 {
-    xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
-    xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
+    xmpp_stanza_t *presence = xmpp_presence_new(ctx);
     xmpp_stanza_set_to(presence, full_room_jid);
     _stanza_add_unique_id(presence, "join");
 
@@ -584,9 +583,8 @@ xmpp_stanza_t*
 stanza_create_room_newnick_presence(xmpp_ctx_t *ctx,
     const char *const full_room_jid)
 {
-    xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
+    xmpp_stanza_t *presence = xmpp_presence_new(ctx);
     _stanza_add_unique_id(presence, "sub");
-    xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
     xmpp_stanza_set_to(presence, full_room_jid);
 
     return presence;
@@ -600,8 +598,7 @@ stanza_create_room_leave_presence(xmpp_ctx_t *ctx, const char *const room,
     g_string_append(full_jid, "/");
     g_string_append(full_jid, nick);
 
-    xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
-    xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
+    xmpp_stanza_t *presence = xmpp_presence_new(ctx);
     xmpp_stanza_set_type(presence, STANZA_TYPE_UNAVAILABLE);
     xmpp_stanza_set_to(presence, full_jid->str);
     _stanza_add_unique_id(presence, "leave");
@@ -868,15 +865,6 @@ stanza_create_room_kick_iq(xmpp_ctx_t *const ctx, const char *const room, const
 }
 
 xmpp_stanza_t*
-stanza_create_presence(xmpp_ctx_t *const ctx)
-{
-    xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
-    xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
-
-    return presence;
-}
-
-xmpp_stanza_t*
 stanza_create_software_version_iq(xmpp_ctx_t *ctx, const char *const fulljid)
 {
     char *id = create_unique_id("sv");