feat(protocol): read current group admin settings
Group detail and ext-info can now return the join option, search flags, invite/permission/history bits, and robot-add switch so setters have a matching read path.
This commit is contained in:
13 files changed
+284
-2
No files matched your search
+12
@@ -5,6 +5,7 @@ import type { OidbBase } from '@snowluma/proto-defs/oidb';
|
||||
import type { Oidb0x89a_0HistoryVisibility } from '@snowluma/proto-defs/oidb-actions/base';
|
||||
|
||||
import {
|
||||
decodeGroupHistoryVisibility,
|
||||
GROUP_HISTORY_VISIBILITY_MASK,
|
||||
mergeGroupHistoryVisibility,
|
||||
SetNewMemberHistoryVisibility,
|
||||
@@ -52,6 +53,17 @@ describe('SetNewMemberHistoryVisibility namespace', () => {
|
||||
expect(mergeGroupHistoryVisibility(0xF0000005, false)).toBe(0xF0000001);
|
||||
});
|
||||
|
||||
it('decodes the history-visibility bit', () => {
|
||||
expect(decodeGroupHistoryVisibility(0x80000001)).toBe(false);
|
||||
expect(decodeGroupHistoryVisibility(0x80000005)).toBe(true);
|
||||
expect(decodeGroupHistoryVisibility(0)).toBe(false);
|
||||
});
|
||||
|
||||
it('round-trips history visibility through merge then decode', () => {
|
||||
expect(decodeGroupHistoryVisibility(mergeGroupHistoryVisibility(0x80000001, true))).toBe(true);
|
||||
expect(decodeGroupHistoryVisibility(mergeGroupHistoryVisibility(0x80000005, false))).toBe(false);
|
||||
});
|
||||
|
||||
it('keeps an explicit zero value on the wire', async () => {
|
||||
const sender = makeSender();
|
||||
await SetNewMemberHistoryVisibility.invoke(sender, {
|
||||
|
||||
Reference in new issue
Block a user