Download:
child 29:8d134e4f876c
parent 27:f59d389adcc4
28:1efbfe153b8f
Anton Shestakov <av6@dwimlabs.net>, Mon, 21 Mar 2016 21:40:30 +0800
index: send presence on connect, handle incoming presences, show contacts

4 файлов изменено, 180 вставок(+), 2 удалений(-) [+]
coffee/index.coffee file | annotate | diff | comparison | revisions
index.html file | annotate | diff | comparison | revisions
js/index.js file | annotate | diff | comparison | revisions
js/index.js.map file | annotate | diff | comparison | revisions
--- a/coffee/index.coffee Mon Mar 21 21:13:17 2016 +0800
+++ b/coffee/index.coffee Mon Mar 21 21:40:30 2016 +0800
@@ -5,6 +5,10 @@
onConnected = ->
+ X.conn.addHandler(onPresence, null, 'presence')
+
+ X.conn.send($pres().c('priority').t('1').up().c('status').t('Online').tree())
+
getVersion()
@@ -49,6 +53,92 @@
X.conn.sendIQ(iq.tree(), okcb, failcb, 5000)
+getContact = (from) ->
+ contact = contacts.get(from)
+ if contact?
+ return contact
+
+ self = from is X.conn.jid
+
+ contact = contacts.add
+ jid: from
+ type: if self then 'self' else 'contact'
+
+ getContactProfile(contact)
+
+ return contact
+
+
+getContactProfile = (contact) ->
+ okcb = (stanza) ->
+ vcard = stanza.getElementsByTagName('vCard')[0]
+ if !vcard
+ console.warn("no vcard in response", stanza)
+ return
+
+ contact.set
+ nickname: getText(vcard.querySelector('NICKNAME'))
+ fullname: getText(vcard.querySelector('FN'))
+ firstname: getText(vcard.querySelector('N > GIVEN'))
+ lastname: getText(vcard.querySelector('N > FAMILY'))
+
+ failcb = (stanza) ->
+ console.warn("couldn't get vcard", stanza)
+
+ bjid = Strophe.getBareJidFromJid(contact.get('jid'))
+ if bjid is Strophe.getBareJidFromJid(X.conn.jid)
+ bjid = null
+
+ X.conn.vcard.get(okcb, bjid, failcb)
+
+
+onPresence = (stanza) ->
+ from = stanza.getAttribute('from')
+ type = stanza.getAttribute('type') ? 'online'
+ if type is 'subscribe'
+ console.warn('not handling <presence type="subscribe">', stanza)
+ return true
+
+ if type is 'subscribed'
+ console.warn('not handling <presence type="subscribed">', stanza)
+ return true
+
+ if type is 'error'
+ console.error('got <presence type="error">', stanza)
+ return true
+
+ delay = stanza.getElementsByTagName('delay')[0]
+ stamp = if delay then new Date(delay.getAttribute('stamp')) else new Date()
+
+ priority = stanza.getElementsByTagName('priority')[0]
+ priority = if priority then getText(priority) else '0'
+
+ show = stanza.getElementsByTagName('show')[0]
+ show = if show then getText(show) else undefined
+
+ s = stanza.getElementsByTagName('status')[0]
+ s = if s then getText(s) else undefined
+
+ contact = getContact(from)
+ contact.set
+ presence: type
+ show: show
+ status: s
+
+ messages.add
+ id: stanza.getAttribute('id')
+ type: 'presence'
+ cls: 'presence'
+ from: from
+ stamp: stamp
+ contact: contact
+ show: show
+ priority: priority
+ text: 'is now ' + (show ? type)
+
+ return true
+
+
window.X = new Tram.XMPPInterface()
--- a/index.html Mon Mar 21 21:13:17 2016 +0800
+++ b/index.html Mon Mar 21 21:40:30 2016 +0800
@@ -14,6 +14,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.25.0/js/uikit.min.js"></script>
<script src="/vendor/strophejs/strophe.min.js"></script>
+ <script src="/vendor/strophejs-plugins/vcard/strophe.vcard.js"></script>
</head>
<body>
<div class="smart-container" data-step="noscript">
--- a/js/index.js Mon Mar 21 21:13:17 2016 +0800
+++ b/js/index.js Mon Mar 21 21:40:30 2016 +0800
@@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.10.0
(function() {
- var $form, getText, getVersion, onConnected;
+ var $form, getContact, getContactProfile, getText, getVersion, onConnected, onPresence;
if (window.contacts == null) {
window.contacts = new Tram.Contacts();
@@ -25,6 +25,8 @@
}
onConnected = function() {
+ X.conn.addHandler(onPresence, null, 'presence');
+ X.conn.send($pres().c('priority').t('1').up().c('status').t('Online').tree());
return getVersion();
};
@@ -81,6 +83,91 @@
return X.conn.sendIQ(iq.tree(), okcb, failcb, 5000);
};
+ getContact = function(from) {
+ var contact, self;
+ contact = contacts.get(from);
+ if (contact != null) {
+ return contact;
+ }
+ self = from === X.conn.jid;
+ contact = contacts.add({
+ jid: from,
+ type: self ? 'self' : 'contact'
+ });
+ getContactProfile(contact);
+ return contact;
+ };
+
+ getContactProfile = function(contact) {
+ var bjid, failcb, okcb;
+ okcb = function(stanza) {
+ var vcard;
+ vcard = stanza.getElementsByTagName('vCard')[0];
+ if (!vcard) {
+ console.warn("no vcard in response", stanza);
+ return;
+ }
+ return contact.set({
+ nickname: getText(vcard.querySelector('NICKNAME')),
+ fullname: getText(vcard.querySelector('FN')),
+ firstname: getText(vcard.querySelector('N > GIVEN')),
+ lastname: getText(vcard.querySelector('N > FAMILY'))
+ });
+ };
+ failcb = function(stanza) {
+ return console.warn("couldn't get vcard", stanza);
+ };
+ bjid = Strophe.getBareJidFromJid(contact.get('jid'));
+ if (bjid === Strophe.getBareJidFromJid(X.conn.jid)) {
+ bjid = null;
+ }
+ return X.conn.vcard.get(okcb, bjid, failcb);
+ };
+
+ onPresence = function(stanza) {
+ var contact, delay, from, priority, ref, s, show, stamp, type;
+ from = stanza.getAttribute('from');
+ type = (ref = stanza.getAttribute('type')) != null ? ref : 'online';
+ if (type === 'subscribe') {
+ console.warn('not handling <presence type="subscribe">', stanza);
+ return true;
+ }
+ if (type === 'subscribed') {
+ console.warn('not handling <presence type="subscribed">', stanza);
+ return true;
+ }
+ if (type === 'error') {
+ console.error('got <presence type="error">', stanza);
+ return true;
+ }
+ delay = stanza.getElementsByTagName('delay')[0];
+ stamp = delay ? new Date(delay.getAttribute('stamp')) : new Date();
+ priority = stanza.getElementsByTagName('priority')[0];
+ priority = priority ? getText(priority) : '0';
+ show = stanza.getElementsByTagName('show')[0];
+ show = show ? getText(show) : void 0;
+ s = stanza.getElementsByTagName('status')[0];
+ s = s ? getText(s) : void 0;
+ contact = getContact(from);
+ contact.set({
+ presence: type,
+ show: show,
+ status: s
+ });
+ messages.add({
+ id: stanza.getAttribute('id'),
+ type: 'presence',
+ cls: 'presence',
+ from: from,
+ stamp: stamp,
+ contact: contact,
+ show: show,
+ priority: priority,
+ text: 'is now ' + (show != null ? show : type)
+ });
+ return true;
+ };
+
window.X = new Tram.XMPPInterface();
X.on('connecting', function() {
--- a/js/index.js.map Mon Mar 21 21:13:17 2016 +0800
+++ b/js/index.js.map Mon Mar 21 21:40:30 2016 +0800
@@ -6,5 +6,5 @@
"coffee/index.coffee"
],
"names": [],
- "mappings": ";AAAA;AAAA,MAAA;;;IAAA,MAAM,CAAC,WAAgB,IAAA,IAAI,CAAC,QAAL,CAAA;;;;IACvB,MAAM,CAAC,cAAmB,IAAA,IAAI,CAAC,WAAL,CAAiB;MAAA,EAAA,EAAI,CAAA,CAAE,uBAAF,CAAJ;MAAgC,UAAA,EAAY,QAA5C;KAAjB;;;;IAC1B,MAAM,CAAC,WAAgB,IAAA,IAAI,CAAC,QAAL,CAAA;;;;IACvB,MAAM,CAAC,SAAc,IAAA,IAAI,CAAC,MAAL,CAAY;MAAA,EAAA,EAAI,CAAA,CAAE,kBAAF,CAAJ;MAA2B,UAAA,EAAY,QAAvC;KAAZ;;;EAGrB,WAAA,GAAc,SAAA;WACZ,UAAA,CAAA;EADY;;EAId,OAAA,GAAU,SAAC,EAAD;AACR,QAAA;IAAA,IAAG,CAAI,EAAP;AACE,aAAO,KADT;;IAGA,GAAA,GAAM;IACN,IAAG,EAAE,CAAC,UAAU,CAAC,MAAd,KAAwB,CAAxB,IAA8B,EAAE,CAAC,QAAH,KAAe,OAAO,CAAC,WAAW,CAAC,IAApE;MACE,GAAA,IAAO,EAAE,CAAC,UADZ;;AAGA;AAAA,SAAA,qCAAA;;MACE,IAAG,IAAI,CAAC,QAAL,KAAiB,OAAO,CAAC,WAAW,CAAC,IAAxC;QACE,GAAA,IAAO,IAAI,CAAC,UADd;;AADF;AAIA,WAAO;EAZC;;EAeV,UAAA,GAAa,SAAA;AACX,QAAA;IAAA,EAAA,GAAK,GAAA,CAA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