Skip to content

Commit

Permalink
Fix standby logic pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
quartata committed Dec 7, 2017
1 parent 089d5c8 commit ecae8ac
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions chatcommunicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,15 @@ def init(username, password):
else:
parse_room_config("rooms.yml")

for site, roomid in _command_rooms:
room = _clients[site].get_room(roomid)
deletion_watcher = (site, roomid) in _watcher_rooms
if not GlobalVars.standby_mode:
for site, roomid in _command_rooms:
room = _clients[site].get_room(roomid)
deletion_watcher = (site, roomid) in _watcher_rooms

if not GlobalVars.standby_mode:
room.join()
room.watch_socket(on_msg)

_rooms[(site, roomid)] = RoomData(room, threading.Event(), -1, (), deletion_watcher)
_rooms[(site, roomid)].lock.set()
_rooms[(site, roomid)] = RoomData(room, threading.Event(), -1, (), deletion_watcher)
_rooms[(site, roomid)].lock.set()

if os.path.isfile("messageData.p"):
_last_messages = pickle.load(open("messageData.p", "rb"))
Expand Down Expand Up @@ -230,9 +229,7 @@ def tell_rooms(msg, has, hasnt, notify_site="", report_data=()):
deletion_watcher = room in _watcher_rooms

new_room = _clients[site].get_room(roomid)

if not GlobalVars.standby_mode:
new_room.join()
new_room.join()

_rooms[room] = RoomData(new_room, threading.Event(), -1, (), deletion_watcher)
_rooms[room].lock.set()
Expand Down

0 comments on commit ecae8ac

Please sign in to comment.