about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-06-01 23:27:46 +0100
committerJames Booth <boothj5@gmail.com>2013-06-01 23:27:46 +0100
commitd49a01a9c37b6aff82cac6a61269a87b3bb211dd (patch)
tree8e97c6b38329b634dd3b283dc5323a4277460317 /src/xmpp
parent83c41776928a71faa858d509aa6cf8cf451569a7 (diff)
downloadprofani-tty-d49a01a9c37b6aff82cac6a61269a87b3bb211dd.tar.gz
Added roster list when using /roster with no args
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/presence.c13
-rw-r--r--src/xmpp/xmpp.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c
index 6a7c214f..5aa94c1d 100644
--- a/src/xmpp/presence.c
+++ b/src/xmpp/presence.c
@@ -153,6 +153,19 @@ presence_sub_request_find(char * search_str)
     return autocomplete_complete(sub_requests_ac, search_str);
 }
 
+gboolean
+presence_sub_request_exists(const char * const bare_jid)
+{
+    GSList *requests = autocomplete_get_list(sub_requests_ac);
+    while (requests != NULL) {
+        if (strcmp(requests->data, bare_jid) == 0) {
+            return TRUE;
+        }
+        requests = g_slist_next(requests);
+    }
+    return FALSE;
+}
+
 void
 presence_reset_sub_request_search(void)
 {
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index 70b41d59..9cc33674 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -113,6 +113,7 @@ void presence_change_room_nick(const char * const room, const char * const nick)
 void presence_leave_chat_room(const char * const room_jid);
 void presence_update(resource_presence_t status, const char * const msg,
     int idle);
+gboolean presence_sub_request_exists(const char * const bare_jid);
 
 // iq functions
 void iq_send_software_version(const char * const fulljid);