diff options
author | Kim Alvefur <zash@zash.se> | 2015-04-05 16:19:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-04-05 16:19:02 +0200 |
commit | 65c3cf814bdc794eddf78d2f7037d1d59ebc995a (patch) | |
tree | 760c2946c0b1c7a29be53929ebc7f52b7f610ab3 /core | |
parent | 699bb065b9587204b0b4e200bf0c36e55d8d7c8f (diff) | |
download | prosody-65c3cf814bdc794eddf78d2f7037d1d59ebc995a.tar.gz prosody-65c3cf814bdc794eddf78d2f7037d1d59ebc995a.zip |
rostermanager: Fix roster upgrade code (thanks mva)
Diffstat (limited to 'core')
-rw-r--r-- | core/rostermanager.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index b39e5323..612a349f 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -86,12 +86,11 @@ local function roster_metadata(roster, err) metadata = { broken = err or nil }; roster[false] = metadata; end - if not metadata.pending then - if roster.pending and not type(roster.pending.subscription) == "string" then - metadata.pending, roster.pending = roster.pending, nil; - else - metadata.pending = {}; - end + if roster.pending and type(roster.pending.subscription) ~= "string" then + metadata.pending = roster.pending; + roster.pending = nil; + elseif not metadata.pending then + metadata.pending = {}; end return metadata; end |