mirror of https://gitlab.com/litecord/litecord.git
guild.members: call pres_dispatch on role updates
- presence: fix 'everyone' list detection
This commit is contained in:
parent
7103ac01ca
commit
58c818bb68
|
|
@ -141,6 +141,15 @@ async def modify_guild_member(guild_id, member_id):
|
||||||
member = await app.storage.get_member_data_one(guild_id, member_id)
|
member = await app.storage.get_member_data_one(guild_id, member_id)
|
||||||
member.pop('joined_at')
|
member.pop('joined_at')
|
||||||
|
|
||||||
|
lazy_guilds = app.dispatcher.backends['lazy_guild']
|
||||||
|
lists = lazy_guilds.get_gml_guild(guild_id)
|
||||||
|
|
||||||
|
for member_list in lists:
|
||||||
|
# just call pres_update but only for role changes.
|
||||||
|
await member_list.pres_update(member_id, {
|
||||||
|
'roles': member['roles'],
|
||||||
|
})
|
||||||
|
|
||||||
await app.dispatcher.dispatch_guild(guild_id, 'GUILD_MEMBER_UPDATE', {**{
|
await app.dispatcher.dispatch_guild(guild_id, 'GUILD_MEMBER_UPDATE', {**{
|
||||||
'guild_id': str(guild_id)
|
'guild_id': str(guild_id)
|
||||||
}, **member})
|
}, **member})
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,9 @@ class PresenceManager:
|
||||||
log.debug('Lazy Dispatch to {}',
|
log.debug('Lazy Dispatch to {}',
|
||||||
len(session_ids))
|
len(session_ids))
|
||||||
|
|
||||||
if member_list.channel_id == 'everyone':
|
# if we are on the 'everyone' member list, we don't
|
||||||
|
# dispatch a PRESENCE_UPDATE for those shards.
|
||||||
|
if member_list.channel_id == member_list.guild_id:
|
||||||
in_lazy.extend(session_ids)
|
in_lazy.extend(session_ids)
|
||||||
|
|
||||||
pres_update_payload = {
|
pres_update_payload = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue