ConverseJS:如何为muc聊天室中的所有消息启用声音通知?

时间:2017-08-17 16:43:21

标签: javascript converse.js

ConverseJS(版本3.2)中的play_sounds选项允许在您收到个人信息时或在聊天室中提及您的昵称时播放通知声音" (see here)。有没有办法为muc聊天室中的每条新消息播放声音,而不仅仅是那些提及用​​户的消息?

1 个答案:

答案 0 :(得分:1)

是的,有办法做到这一点。

使用notify_all_room_messages设置。

从以上链接:

如果您将此设置设为true,则系统会通知您收到房间内收到的所有邮件。

这是指声音通知和HTML5桌面通知。

只收听部分房间的通知:

converse.initialize({
        // Other config settings omitted for brevity
        // ...

        notify_all_room_messages: [                                                  
            'foo@conference.exampl.org',
            'bar@conference.example.org',                            
                   │
        ]
});

或者为所有房间启用通知:

converse.initialize({
        // Other config settings omitted for brevity
        // ...

        notify_all_room_messages: true                                               
});