Changeset

6624:7f9b49f2758a

rostermanager: Fix roster upgrade code (thanks mva)
author Kim Alvefur <zash@zash.se>
date Sun, 05 Apr 2015 16:19:02 +0200
parents 6622:fb60cee2144e
children 6625:bae327ea487a 6627:c6e025411baa
files core/rostermanager.lua
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/core/rostermanager.lua	Fri Apr 03 21:42:30 2015 +0200
+++ b/core/rostermanager.lua	Sun Apr 05 16:19:02 2015 +0200
@@ -86,12 +86,11 @@
 		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