diff mcabber/mcabber/utils.c @ 2346:7921c8d671c8

Implemented another helper function jid_get_resource_name
author franky
date Tue, 14 May 2019 22:19:33 +0200
parents 6424627913be
children
line wrap: on
line diff
--- a/mcabber/mcabber/utils.c	Sat May 11 23:06:34 2019 +0200
+++ b/mcabber/mcabber/utils.c	Tue May 14 22:19:33 2019 +0200
@@ -142,6 +142,17 @@
   return (ret == 0) ? TRUE : FALSE;
 }
 
+const char *jid_get_resource_name(const char *fjid)
+{
+  const char * resource_name = NULL;
+  if (fjid) {
+    resource_name = strchr(fjid, JID_RESOURCE_SEPARATOR);
+    if (resource_name)
+      resource_name++;
+  }
+  return resource_name;
+}
+
 //  expand_filename(filename)
 // Expand "~/" with the $HOME env. variable in a file name.
 // The caller must free the string after use.