From 9375fd7fe62f054d1315b7398b9c6a1e192002f3 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Tue, 22 Apr 2014 10:21:15 +0900 Subject: [PATCH] Allow invites for an already joined member to succeed. --- lib/roles/device/plugins/group.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/roles/device/plugins/group.js b/lib/roles/device/plugins/group.js index 52cab793..08b7098f 100644 --- a/lib/roles/device/plugins/group.js +++ b/lib/roles/device/plugins/group.js @@ -32,7 +32,11 @@ module.exports = syrup.serial() plugin.join = function(newGroup, timeout) { return plugin.get() .then(function() { - throw new grouputil.AlreadyGroupedError() + if (currentGroup.group !== newGroup.group) { + throw new grouputil.AlreadyGroupedError() + } + + return currentGroup }) .catch(grouputil.NoGroupError, function() { currentGroup = newGroup