Comparison

core/rostermanager.lua @ 173:f3a2af4d2ff2

Inbound unsubscribe
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 02:38:24 +0500
parent 172:71247788c7c7
child 174:f9aff1fc7e99
comparison
equal deleted inserted replaced
172:71247788c7c7 173:f3a2af4d2ff2
119 -- FIXME do we need to item.ask = nil;? 119 -- FIXME do we need to item.ask = nil;?
120 return datamanager.store(username, host, "roster", roster); 120 return datamanager.store(username, host, "roster", roster);
121 end 121 end
122 end 122 end
123 123
124 function process_inbound_unsubscribe(username, host, jid)
125 local roster = load_roster(username, host);
126 local item = roster[jid];
127 if item and (item.subscription == "from" or item.subscription == "both") then
128 if item.subscription == "from" then
129 item.subscription = "none";
130 else
131 item.subscription = "to";
132 end
133 item.ask = nil;
134 return datamanager.store(username, host, "roster", roster);
135 end
136 end
137
124 return _M; 138 return _M;