示例#1
0
 def on_receive_g_participants(self, args):
     args = ":".join(args)
     args = args.split(";")
     self._user_count = len(args)
     for data in args:
         data = data.split(":")
         name = data[3]
         uid = name.lower()
         if uid == "none":
             continue
         self._recent_list.append(uid)
         user = User(
             uid=name,
             room=self
         )
         user.add_session_id(self, data[0])
         self._user_list.append(user)
示例#2
0
 def on_receive_participant(self, args):
     if args[0] == "0":
         #leave
         name = args[3]
         uid = name.lower()
         if uid == "none":
             return
         if uid in self._recent_list:
             self._recent_list.remove(uid)
         user = User(name)
         user.remove_session_id(self, args[1])
         self._user_list.remove(user)
         if (
             user not in self._user_list
             or not self._user_list_event_unique
         ):
             self.fire_event("leave", user)
     else:
         #join
         name = args[3]
         uid = name.lower()
         if uid == "none":
             return
         if not uid in self._recent_list:
             self._recent_list.append(uid)
         user = User(
             uid=name,
             room=self
         )
         user.add_session_id(self, args[1])
         if user not in self._user_list:
             do_event = True
         else:
             do_event = False
         self._user_list.append(user)
         if do_event or not self._user_list_event_unique:
             self.fire_event("join", user)