about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jid.c12
-rw-r--r--src/jid.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/jid.c b/src/jid.c
index 4eef9384..04c69636 100644
--- a/src/jid.c
+++ b/src/jid.c
@@ -20,6 +20,7 @@
  *
  */
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <glib.h>
@@ -98,6 +99,17 @@ jid_create(const gchar * const str)
     }
 }
 
+Jid *
+jid_create_room_jid(const char * const room, const char * const nick)
+{
+    Jid *result;
+    char *jid = create_full_room_jid(room, nick);
+    result = jid_create(jid);
+    free(jid);
+
+    return result;
+}
+
 /*
  * Given a full room JID of the form
  * room@server/nick
diff --git a/src/jid.h b/src/jid.h
index 3b172025..5a34c02e 100644
--- a/src/jid.h
+++ b/src/jid.h
@@ -36,6 +36,7 @@ struct jid_t {
 typedef struct jid_t Jid;
 
 Jid * jid_create(const gchar * const str);
+Jid * jid_create_room_jid(const char * const room, const char * const nick);
 
 gboolean jid_is_room(const char * const room_jid);
 char * create_full_room_jid(const char * const room,