aboutsummaryrefslogtreecommitdiff
path: root/vala-xmpp/src/module/util.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-02 15:37:32 +0100
committerfiaxh <git@mx.ax.lt>2017-03-02 15:37:32 +0100
commit56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d (patch)
tree0bd0c2c80cb81179c26282fb3fbe8fd22983f40b /vala-xmpp/src/module/util.vala
downloaddino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.tar.gz
dino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.zip
Initial commit
Diffstat (limited to 'vala-xmpp/src/module/util.vala')
-rw-r--r--vala-xmpp/src/module/util.vala13
1 files changed, 13 insertions, 0 deletions
diff --git a/vala-xmpp/src/module/util.vala b/vala-xmpp/src/module/util.vala
new file mode 100644
index 00000000..4d762883
--- /dev/null
+++ b/vala-xmpp/src/module/util.vala
@@ -0,0 +1,13 @@
+namespace Xmpp {
+ string? get_bare_jid(string jid) {
+ return jid.split("/")[0];
+ }
+
+ bool is_bare_jid(string jid) {
+ return !jid.contains("/");
+ }
+
+ string? get_resource_part(string jid) {
+ return jid.split("/")[1];
+ }
+} \ No newline at end of file