diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-03-30 02:02:59 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-03-30 02:02:59 +0500 |
commit | 3570fb634c8e888c8cd418067bc35601405fb532 (patch) | |
tree | aebfb526a1e5622259cc4b2cd6827ce46a4ae25f /core | |
parent | 0f9fd252f66c66629d1e59720750a972e5945cf5 (diff) | |
download | prosody-3570fb634c8e888c8cd418067bc35601405fb532.tar.gz prosody-3570fb634c8e888c8cd418067bc35601405fb532.zip |
Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77)
Diffstat (limited to 'core')
-rw-r--r-- | core/rostermanager.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index fdaf64a7..867add2c 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -224,6 +224,10 @@ function subscribed(username, host, jid) if is_contact_pending_in(username, host, jid) then local roster = load_roster(username, host); local item = roster[jid]; + if not item then -- FIXME should roster item be auto-created? + item = {subscription = "none", groups = {}}; + roster[jid] = item; + end if item.subscription == "none" then item.subscription = "from"; else -- subscription == to |