diff --git a/src/client/webapp/elements/contexts/context-menu-connection-info.tsx b/src/client/webapp/elements/contexts/context-menu-connection-info.tsx index 12e4af9..839c41f 100644 --- a/src/client/webapp/elements/contexts/context-menu-connection-info.tsx +++ b/src/client/webapp/elements/contexts/context-menu-connection-info.tsx @@ -16,8 +16,10 @@ const ConnectionInfoContextMenu: FC = (props: Co const { guild, selfMember, relativeToRef, close, setOverlay } = props; const setSelfStatus = useCallback(async (status: string) => { - await guild.requestSetStatus(status); - }, [ guild ]); + if (selfMember.status !== status) { + await guild.requestSetStatus(status); + } + }, [ guild, selfMember ]); const statusElements = useMemo(() => { return [ 'online', 'away', 'busy', 'invisible' ].map(status => { diff --git a/src/server/server-controller.ts b/src/server/server-controller.ts index 3e26d96..330d341 100644 --- a/src/server/server-controller.ts +++ b/src/server/server-controller.ts @@ -634,12 +634,16 @@ function bindActionEvents(io: socketio.Server, client: socketio.Socket, identity LOG.info(`u#${identity.memberId}: setting status to ${status}`); + const before = await DB.getMember(identity.guildId, identity.memberId); await DB.setMemberStatus(identity.guildId, identity.memberId, status); const updated = await DB.getMember(identity.guildId, identity.memberId); respond(null, updated); - - io.to(identity.guildId).emit('update-member', updated); + + if (before.status !== updated.status) { + // Only send the update event if it actually changed + io.to(identity.guildId).emit('update-member', updated); + } } );