mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
Show WA nicknames and auto-fill group subjects in access UI (4.9.1-ops.9).
Fetch groupMetadata.subject on @mentions for group cards; render contact pushName under phone rows so admins are not staring at bare numbers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
e8e58924ca
commit
a169b164a8
10 changed files with 268 additions and 182 deletions
21
test/channels/whatsapp/group-subject.test.mjs
Normal file
21
test/channels/whatsapp/group-subject.test.mjs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { resolveWhatsappGroupSubject } from '../../../src/channels/whatsapp/whatsapp-identity.mjs';
|
||||
|
||||
test('resolveWhatsappGroupSubject reads Baileys groupMetadata.subject', async () => {
|
||||
const subject = await resolveWhatsappGroupSubject({
|
||||
groupMetadata: async (jid) => {
|
||||
assert.equal(jid, '120363429229984366@g.us');
|
||||
return { subject: ' 运维值班群 ' };
|
||||
},
|
||||
}, '120363429229984366@g.us');
|
||||
assert.equal(subject, '运维值班群');
|
||||
});
|
||||
|
||||
test('resolveWhatsappGroupSubject fails soft without socket metadata', async () => {
|
||||
assert.equal(await resolveWhatsappGroupSubject(null, '120363429229984366@g.us'), '');
|
||||
assert.equal(await resolveWhatsappGroupSubject({
|
||||
groupMetadata: async () => { throw new Error('offline'); },
|
||||
}, '120363429229984366@g.us'), '');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue