Move Death Link change tag to Common Client

This commit is contained in:
CaitSith2
2021-11-24 01:38:58 -08:00
parent 1f61d8322c
commit 1f5d1532e3
2 changed files with 10 additions and 8 deletions

View File

@@ -315,6 +315,15 @@ class CommonContext():
self.input_requests -= 1
self.keep_alive_task.cancel()
async def update_death_link(self, death_link):
old_tags = self.tags.copy()
if death_link:
self.tags.add("DeathLink")
else:
self.tags -= {"DeathLink"}
if old_tags != self.tags and self.server and not self.server.socket.closed:
await self.send_msgs([{"cmd": "ConnectUpdate", "tags": self.tags}])
async def keep_alive(ctx: CommonContext, seconds_between_checks=100):
"""some ISPs/network configurations drop TCP connections if no payload is sent (ignore TCP-keep-alive)