about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
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);