From 3b0f4eb6ee40c6f29fe5887893f43adbb0135c0c Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Thu, 7 May 2009 20:21:39 +0200 Subject: [PATCH] Small message changes/fixes and consistency change --- css/standard.css | 7 +++++++ scripts/basic.js | 4 +++- scripts/classes.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/css/standard.css b/css/standard.css index 1792f53..25e4aed 100644 --- a/css/standard.css +++ b/css/standard.css @@ -43,3 +43,10 @@ .sender { color: blue; } + +.chat { + width: 30%; + height: 30%; + padding: 1em; + border: 2px solid; +} diff --git a/scripts/basic.js b/scripts/basic.js index a4b4a18..1ef9115 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -158,7 +158,7 @@ function _cbRoster(e) { 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(); + var initialPresence = $pres().c('show').t('online').up().c('status').t('Hy, I am an socialXMPP instance').up().c('priority').t('0').up().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up(); connection.send(initialPresence.tree()); return false; @@ -191,6 +191,8 @@ function _cbDisco(e) { } function _cbMessage(msg) { + if ($(msg).attr('type') != 'chat') + return; var jid = $(msg).attr('from'); var id = jid2id($(msg).attr('from')) + 'Chat'; var body = $(msg).find('body:first').text(); diff --git a/scripts/classes.js b/scripts/classes.js index 8ada8d8..c991a8a 100644 --- a/scripts/classes.js +++ b/scripts/classes.js @@ -11,7 +11,7 @@ Tune = function() { Buddy = function(name, jid) { this.name = name; this.jid = jid; - this.vCard = ""; + this.vCard = ''; this.tune = new Tune(); }; -- 2.39.5