Comparison

core/rostermanager.lua @ 172:71247788c7c7

Inbound subscription cancellation
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 02:29:58 +0500
parent 171:28f420d057a0
child 173:f3a2af4d2ff2
comparison
equal deleted inserted replaced
171:28f420d057a0 172:71247788c7c7
105 item.ask = nil; 105 item.ask = nil;
106 return datamanager.store(username, host, "roster", roster); 106 return datamanager.store(username, host, "roster", roster);
107 end 107 end
108 end 108 end
109 109
110 function process_inbound_subscription_cancellation(username, host, jid)
111 local roster = load_roster(username, host);
112 local item = roster[jid];
113 if item and (item.subscription == "to" or item.subscription == "both") then
114 if item.subscription == "to" then
115 item.subscription = "none";
116 else
117 item.subscription = "from";
118 end
119 -- FIXME do we need to item.ask = nil;?
120 return datamanager.store(username, host, "roster", roster);
121 end
122 end
123
110 return _M; 124 return _M;