Diff

core/rostermanager.lua @ 174:f9aff1fc7e99

Inbound subscription request
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 03:13:10 +0500
parent 173:f3a2af4d2ff2
child 176:e5cd2a03891d
line wrap: on
line diff
--- a/core/rostermanager.lua	Sat Oct 25 02:38:24 2008 +0500
+++ b/core/rostermanager.lua	Sat Oct 25 03:13:10 2008 +0500
@@ -135,4 +135,10 @@
 	end
 end
 
+function is_contact_subscribed(username, host, jid)
+	local roster = load_roster(username, host);
+	local item = roster[jid];
+	return item and (item.subscription == "from" or item.subscription == "both");
+end
+
 return _M;
\ No newline at end of file