Mercurial > prosody-hg
comparison core/rostermanager.lua @ 925:4861bcf0afa4
Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77)
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Mon, 30 Mar 2009 02:02:59 +0500 |
| parents | f0743928ef7e |
| children | 9b3b43b8963a |
comparison
equal
deleted
inserted
replaced
| 924:db022135aed4 | 925:4861bcf0afa4 |
|---|---|
| 222 end | 222 end |
| 223 function subscribed(username, host, jid) | 223 function subscribed(username, host, jid) |
| 224 if is_contact_pending_in(username, host, jid) then | 224 if is_contact_pending_in(username, host, jid) then |
| 225 local roster = load_roster(username, host); | 225 local roster = load_roster(username, host); |
| 226 local item = roster[jid]; | 226 local item = roster[jid]; |
| 227 if not item then -- FIXME should roster item be auto-created? | |
| 228 item = {subscription = "none", groups = {}}; | |
| 229 roster[jid] = item; | |
| 230 end | |
| 227 if item.subscription == "none" then | 231 if item.subscription == "none" then |
| 228 item.subscription = "from"; | 232 item.subscription = "from"; |
| 229 else -- subscription == to | 233 else -- subscription == to |
| 230 item.subscription = "both"; | 234 item.subscription = "both"; |
| 231 end | 235 end |
