otalk / jxt-xmpp Goto Github PK
View Code? Open in Web Editor NEWJXT definitions for XMPP
License: MIT License
JXT definitions for XMPP
License: MIT License
I'm not finding any reference to extendIQ
on JXT, but this project is using it - was that something that was removed?
Pubsub allows the creation of instant nodes where you do not provide a node attribute on the create tag as shown here: https://xmpp.org/extensions/xep-0060.html#example-130
It doesn't seem possible right now to create a stanza with a create tag that doesn't have a node attribute.
I'm not sure what needs to be changed to implement this but I noticed here https://github.com/otalk/jxt/blob/8c8ddf81c1ba91cb32fdecbfbf6d468b36682b3c/lib/helpers.js#L92-L96 that when setting a sub attribute the element is only created if the value evaluates to truthy.
Changing it to the following would fix this problem but I'm not sure how this would affect other parts of the code base.
sub = exports.createElement(NS, sub, xml.namespaceURI);
if (value) {
sub.setAttribute(attr, value);
}
xml.appendChild(sub);
Hi Lance, i already wrote some custom IQ extensions with JXT, but i can't find out how to extend top level stanza fileds?
For example i want to add attributes to top level message among from to type etc, it it possible?
I believe in this file: https://github.com/otalk/jxt-xmpp/blob/b46693adc13d164f3e54638c8af9239689e396cf/src/mam.js that lines 64 and 88 need to use Utils.findOrCreate
instead of Utils.find
. Otherwise, deeper in the callstack I get an error when calling find() on the container because it is an empty array the first time.
On lib/mam.js
, you are hardcoding it to use the MAM_2 namespace. We need a way to override that and use MAM_1 or MAM_3 as defined under xmpp-constants
. At the moment, there's no way to use MAM_1 or MAM_3.
When I try to use client.unblock()
in stanza.io, I get an Uncaught ReferenceError in `src/blocking.js':
types is not defined
types
is indeed not defined in this file. I think this should be Utils
instead.
When we get a feature-not-implemented error for pubsub would it be possible to report the feature attribute on the unsupported tag? Right now we only get a pubsubCondition: unsupported
but it doesn't specify which feature.
vue.esm.js?65d7:566 ReferenceError: PubSub is not defined
at exports.default (pubsubOwner.js?3378:107)
at JXT.use (index.js?c76b:26)
at exports.default (index.js?5fb2:305)
at JXT.use (index.js?c76b:26)
at new Client (client.js?9ce5:64)
at Object.exports.createClient (index.js?73af:10)
at VueComponent.connectToServer ()
this is found in file pubsubOwner.js
Hello,
I'm facing an issue with joinMuc history field. In a specific case I explicitly need to ask for 0 maxstanzas, but the following condition https://github.com/otalk/jxt-xmpp/blob/master/src/muc.js#L221 will ignore 0.
Could we add a check on option's type instead ? Or how would you solve this ? I'd be happy to create a PR ;)
(I'm sending "0" to bypass the condition, but I don't think it's a good solution)
@legastero I have this added to jingle-stanza
which helps define data descriptions in jingle contents. Would this fit into this project?
var DCNS = 'urn:xmpp:jingle:transports:webrtc-datachannel:0';
var DataChannel = stanza.define({
name: '_datachannel',
namespace: DCNS,
element: 'description',
tags: ['jingle-description'],
fields: {
descType: {value: 'datachannel'}
}
});
...
stanza.withDefinition('content', 'urn:xmpp:jingle:1', function (Content) {
stanza.extend(Content, RTP);
stanza.extend(Content, DataChannel);
});
According to XEP-0060 node creation should happen in the http://jabber.org/protocol/pubsub namespace not the http://jabber.org/protocol/pubsub#owner namespace
Hi,
How can one add attribute (new field)
to existing element
for example (which is also might be a bug -when downloading stanza.io)
the plugin declare
var Affiliation = JXT.define({
name: 'affiliation',
namespace: _xmppConstants.Namespace.PUBSUB_OWNER,
element: 'affiliation',
fields: {
node: Utils.attribute('node'),
type: Utils.attribute('affiliation'),
}
});
I want to extend it to be
var Affiliation = JXT.define({
name: 'affiliation',
namespace: _xmppConstants.Namespace.PUBSUB_OWNER,
element: 'affiliation',
fields: {
node: Utils.attribute('node'),
type: Utils.attribute('affiliation'),
//added field
jid: Utils.jidAttribute('jid')
}
});
something like:
jxt.withDefinition('affiliation', NS, function (affiliation) {
//what do I do here?
});
thanks,
Lior
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.