Browse code

Kontrola, ci je pri uprave osob v multichate ta osoba tam naozaj

Cinan Rakosnik authored on 16/05/2013 at 20:49:41
Showing 1 changed files
... ...
@@ -32,8 +32,12 @@ class WsController < WebsocketRails::BaseController
32 32
         chats = where_i_am_multichat_owner(client)
33 33
         chats.each do |chat_id|
34 34
             contacts = connection_store[:opened_chats][client][chat_id][:attendants]
35
-            #TODO: kontrola, ak ten clovek sa nenasiel v mutlichate - tak nic nerob
35
+
36
+            size_before = contacts.size
36 37
             contacts -= [somebody_to_kick.to_s]
38
+            size_after = contacts.size
39
+
40
+            return if size_after == size_before
37 41
 
38 42
             if contacts.empty?
39 43
                 destroy_multichat(client.jid, chat_id)