Skip to content

Commit

Permalink
Store user's original channel
Browse files Browse the repository at this point in the history
  • Loading branch information
raku-cat authored and Kissaki committed Mar 15, 2024
1 parent 26f9c68 commit 1c98006
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/idlemove.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def UpdateUserAutoAway(self, server, user):

if update:
index.add(user.session)
self.affectedusers['origchan' + str(user.userid) + str(user.name) + str(user.session)] = user.channel
log.info(
'%ds > %ds: State transition for user %s (%d/%d) from mute %s -> %s / deaf %s -> %s | channel %d -> %d on server %d',
user.idlesecs, threshold, user.name, user.session, user.userid, user.mute, mute, user.deaf,
Expand All @@ -176,7 +177,13 @@ def UpdateUserAutoAway(self, server, user):
if not over_threshold and user.session in self.affectedusers[sid]:
deafen = False
mute = False
channel = user.channel
try:
channel = self.affectedusers['origchan' + str(user.userid) + str(user.name) + str(user.session)]
del self.affectedusers['origchan' + str(user.userid) + str(user.name) + str(user.session)]
except KeyError:
channel = user.channel
log.warning("User's original channel never stored")
pass
index.remove(user.session)
log.info("Restore user %s (%d/%d) on server %d", user.name, user.session, user.userid, server.id())
update = True
Expand Down

0 comments on commit 1c98006

Please sign in to comment.