aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber_util.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-05-30 21:11:20 -0300
committerdequis <dx@dxzone.com.ar>2015-05-30 21:11:20 -0300
commit0f7eccff5b3f7436f50c66e4270009fa6290a578 (patch)
tree6bb388836ad43e2beea4880082b0728201c09772 /protocols/jabber/jabber_util.c
parentc42d9916663ecae98d01c539cf038d9bc99acfbb (diff)
parentf453a7faa95f9210adbdba20644f280cce68c42e (diff)
Merge branch 'develop'
Diffstat (limited to 'protocols/jabber/jabber_util.c')
-rw-r--r--protocols/jabber/jabber_util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c
index 779d502b..38daaa26 100644
--- a/protocols/jabber/jabber_util.c
+++ b/protocols/jabber/jabber_util.c
@@ -819,3 +819,19 @@ gboolean jabber_set_me(struct im_connection *ic, const char *me)
return TRUE;
}
+
+/* Returns new reference! g_free() afterwards. */
+char *jabber_get_bare_jid(char *jid)
+{
+ char *s = NULL;
+
+ if (jid == NULL) {
+ return NULL;
+ }
+
+ if ((s = strchr(jid, '/'))) {
+ return g_strndup(jid, s - jid);
+ } else {
+ return g_strdup(jid);
+ }
+}