我正在尝试从离子2中的xmpp聊天到“所有花名册”列表,但是我找不到它。
allRoster() {
this.connection.muc.init(this.connection);
return new Promise<any>(resolve => {
this.connection.muc.queryOccupants(this.CONFERENCE_SERVICE, function (msg) {
let items = [];
let rosters = msg.querySelectorAll('item');
rosters.forEach(function (roster) {
items.push({
id: roster.getAttribute("jid"),
name: roster.getAttribute("name") || roster.getAttribute("jid"),
lastText: 'Available to Chat',
avata: 'assets/imgs/ben.png'
});
});
resolve(items);
}, function (err) {
console.log("rooms - error: " + err);
console.log(err);
})
});
}