Fix archived threads not getting evicted

Fixes #7541
This commit is contained in:
I. Ahmad 2022-03-09 07:16:46 +05:00 committed by GitHub
parent 3d74da8d70
commit 0db7b22713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -857,10 +857,13 @@ class ConnectionState:
if thread is not None:
old = copy.copy(thread)
thread._update(data)
if thread.archived:
guild._remove_thread(thread)
self.dispatch('thread_update', old, thread)
else:
thread = Thread(guild=guild, state=guild._state, data=data)
guild._add_thread(thread)
if not thread.archived:
guild._add_thread(thread)
self.dispatch('thread_join', thread)
def parse_thread_delete(self, data: gw.ThreadDeleteEvent) -> None: