Beispiel #1
0
        connections.forEach(function(connection) {
            var presence = new Presence({
                to: connection.jid(data.roomSlug),
                from: connection.getRoomJid(data.roomSlug, data.username),
                type: 'unavailable'
            });

            var x = presence.c('x', {
                xmlns: 'http://jabber.org/protocol/muc#user'
            });
            x.c('item', {
                jid: connection.getUserJid(data.username),
                role: 'none',
                affiliation: 'none'
            });
            x.c('status', {
                code: '110'
            });

            this.send(connection, presence);
        }, this);
Beispiel #2
0
        connections.forEach(function(connection) {
            var presence = new Presence({
                to: connection.jid(data.roomSlug),
                from: connection.getRoomJid(data.roomSlug, data.username)
            });

            presence
            .c('x', {
                xmlns: 'http://jabber.org/protocol/muc#user'
            })
            .c('item', {
                jid: connection.getUserJid(data.username),
                affiliation: 'none',
                role: 'participant'
            });

            if (data.user) {
                connection.populateVcard(presence, data.user, this.core);
            }

            this.send(connection, presence);
        }, this);