问题描述
我正在尝试实现简单的 stanzajs 群聊,但在测试中它不清楚来自和到变量。
test('MUC chat',() => {
const client = createClient({});
const incoming: ReceivedMessage = {
body: 'yayyyy',from: '[email protected]/member',to: 'tester@localhost',type: 'groupchat'
};
client.on('groupchat',msg => {
expect(msg).toStrictEqual(incoming);
});
client.emit('message',incoming);
});
https://github.com/legastero/stanza/blob/master/test/muc/messages.ts 没有错误,但其他用户和房间看不到消息。如何向房间发送公共消息。我不明白为什么要:变量是用户而不是房间名称
this.client.on('groupchat',msg => {
console.log("groupchat new")
console.log(msg)
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)