def received_message(self, m): if m.data == "getactive": active = self.parent.botnetserver.getactive cherrypy.log("ui: " + str(active)) for v in active(): self.__class__.sendall(common.phoneStatusUpdate(v)) self.__class__.sendall(common.commandListUpdate(v))
def updatestatus(self, serial, status, model, port, servercommands): knowyou = True try: self.statuses[str(serial)] except KeyError: knowyou = False self.statuses[str(serial)] = common.Phone(str(model), status=="on", int(port), request.remote.ip, json.loads(servercommands), str(serial), common.VideoStatus.NOTSENDING) p = self.statuses[str(serial)] self.uicommchannel(common.phoneStatusUpdate(p)) self.uicommchannel(common.commandListUpdate(p)) return "ok, " + ("already know you" if knowyou else "don't know you")