}
addFriend(entries[item].getAttribute('jid'), nick);
}
+ connection.addHandler(_cbPEP, NS_PEP, 'message');
+ var initialPresence = $pres().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up();
+ connection.send(initialPresence.tree());
+
return false;
}
function _cbPEP(e) {
var from = e.getAttribute('from');
+ if (Strophe.getBareJidFromJid(from) == Strophe.getBareJidFromJid(connection.jid)) {
+ return true; // Drop own PEP events
+ }
var items = e.getElementsByTagName('items')[0];
// Handle Tune
if (items.getAttribute('node') == NS_TUNE) {
} else if (status == Strophe.Status.CONNECTED) {
log('Strophe is connected.');
getRoster();
- connection.addHandler(_cbPEP, NS_PEP, 'message');
connection.addHandler(_cbDisco, Strophe.NS.DISCO_INFO, 'iq', 'get');
- var initialPresence = $pres().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up();
- connection.send(initialPresence.tree());
}
}