Software /
code /
prosody
Comparison
core/rostermanager.lua @ 3111:826cb5f1859b
rostermanager: Return an error string when subscription test fails due to an error.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 24 May 2010 00:35:08 +0500 |
parent | 3110:7426727548ed |
child | 3129:125f03db0b1a |
comparison
equal
deleted
inserted
replaced
3110:7426727548ed | 3111:826cb5f1859b |
---|---|
189 return save_roster(username, host, roster); | 189 return save_roster(username, host, roster); |
190 end | 190 end |
191 end | 191 end |
192 | 192 |
193 function is_contact_subscribed(username, host, jid) | 193 function is_contact_subscribed(username, host, jid) |
194 local roster = load_roster(username, host); | 194 local roster, err = load_roster(username, host); |
195 local item = roster[jid]; | 195 local item = roster[jid]; |
196 return item and (item.subscription == "from" or item.subscription == "both"); | 196 return item and (item.subscription == "from" or item.subscription == "both"), err; |
197 end | 197 end |
198 | 198 |
199 function is_contact_pending_in(username, host, jid) | 199 function is_contact_pending_in(username, host, jid) |
200 local roster = load_roster(username, host); | 200 local roster = load_roster(username, host); |
201 return roster.pending and roster.pending[jid]; | 201 return roster.pending and roster.pending[jid]; |