about summary refs log tree commit diff stats
path: root/src/contact.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
committerJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
commit581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9 (patch)
tree45645cc4fa432bc48be631aa6782469abadc4269 /src/contact.c
parent817857e4c0d986226b7c213debca9de4f32e979a (diff)
downloadprofani-tty-581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9.tar.gz
Coloured contact and subscription in /roster and /group output
Diffstat (limited to 'src/contact.c')
-rw-r--r--src/contact.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/contact.c b/src/contact.c
index bab3d89c..44cbd4b4 100644
--- a/src/contact.c
+++ b/src/contact.c
@@ -252,6 +252,20 @@ p_contact_subscription(const PContact contact)
     return contact->subscription;
 }
 
+gboolean
+p_contact_subscribed(const PContact contact)
+{
+    if (contact->subscription == NULL) {
+        return FALSE;
+    } else if (strcmp(contact->subscription, "to") == 0) {
+        return TRUE;
+    } else if (strcmp(contact->subscription, "both") == 0) {
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
 Resource *
 p_contact_get_resource(const PContact contact, const char * const resource)
 {