fix(protocol): decode nested group operators
Recognize both raw UTF-8 UIDs and nested OperatorInfo envelopes in GroupChange pushes while keeping self-kick and voluntary-leave semantics explicit.\n\nFixes #253.
This commit is contained in:
3 files changed
+56
-5
No files matched your search
@@ -139,6 +139,15 @@ export function decodeNestedOperatorUid(bytes: Uint8Array, context: string): str
|
||||
return assertOperatorUid(uid, context, bytes);
|
||||
}
|
||||
|
||||
const OPERATOR_INFO_FIELD_TAG = 0x0a;
|
||||
|
||||
export function decodeGroupChangeOperatorUid(bytes: Uint8Array, context: string): string {
|
||||
if (!bytes || bytes.length === 0) return '';
|
||||
return bytes[0] === OPERATOR_INFO_FIELD_TAG
|
||||
? decodeNestedOperatorUid(bytes, context)
|
||||
: decodeRawOperatorUid(bytes, context);
|
||||
}
|
||||
|
||||
export function buildTemplateMap(params: Array<{ name?: string; value?: string }>): Map<string, string> {
|
||||
const map = new Map<string, string>();
|
||||
for (const p of params) {
|
||||
|
||||
Reference in new issue
Block a user