Anton Shestakov <av6@dwimlabs.net>, Sun, 20 Mar 2016 23:42:22 +0800
register: autofocus on the first form field
coffee/xmpp.coffee
Permissions: -rw-r--r--
console.debug('connection exists, not reconnecting') @conn = new Strophe.Connection("https://#{ Tram.config.host }/http-bind") connect: (node, pass, onConnect) -> jid = "#{ node }@#{ Tram.config.domain }" @conn.connect(jid, pass, onConnect) startRegistration: (onConnect) -> @conn.register.connect(Tram.config.domain, onConnect) register: (username, password) -> @conn.register.fields.username = username @conn.register.fields.password = password $vcard = $iq(type: 'set').c('vCard', xmlns: Strophe.NS.VCARD) $vcard.c('NICKNAME').t(data.nickname).up() $vcard.c('FN').t(data.fullname).up() bi = data.avatar.indexOf(b) type = data.avatar.substr(dl, bi - dl) binval = data.avatar.substr(bi + bl) console.debug('vcard is set!', arguments) console.warn('vcard is NOT set!', arguments) @conn.sendIQ($vcard.tree(), okcb, failcb) _(Tram.XMPPInterface.prototype).extend(Backbone.Events)