-
chr
hi guys, can any one help me on best xmpp client to use in react native application?
-
Ge0rG
chr: there is no ready-made client with UI, but you can use xmpp.js
-
bala
hi can we add xmpp to laravel 5+?
-
bala
or we want to use any nodejs and react js only?
-
marmistrz
I might've asked, is there anything on par with xmpp.js for typescript?
-
Ge0rG
marmistrz: I'm not aware.
-
Zash
https://github.com/legastero/stanza mayhaps
-
edhelas
bala to Laravel ?
-
sonny
(author of xmpp.js here) xmpp.js has the best RN support AFAIK but is very low level compared to stanza https://github.com/legastero/stanza/blob/master/docs/React_Native.md
-
sonny
if you're not that familiar with xmpp or need builtin TypeScript I'd recommend stanza
-
sonny
some people have shared their TypeScript definition for xmpp.js https://github.com/xmppjs/xmpp.js/issues/542
-
lovetox
hm is just a localpart a valid JID?
-
lovetox
hm my parsing logic says JID("asd")
-
lovetox
is a valid jid
-
lovetox
what JID parsing rule should prevent that?
-
Zash
lovetox: not
-
lovetox
ah i think its recognized as domainpart
-
lovetox
and IDN2008 allows that?
-
sonny
a domain is a valid jid
-
lovetox
hm yes seems its a valid domain
-
lovetox
yes is know
-
lovetox
but i didnt think "asd" is a valid domain
-
lovetox
seems i was wrong
-
jonas’
why wouldn’t it be?
-
lovetox
because a rule exists that says otherwise
-
Ge0rG
with the ICANN going wild with gTLDs, you can't sensibly restrict what a domain name is.
-
Ge0rG
Also you can have local hostnames without a TLD
-
Ge0rG
and things like xmpp.server.local
-
Zash
or localhost
-
Ge0rG
and IP addresses.
-
Ge0rG
IP addresses are legitimate XMPP domains.
-
flow
lovetox> but i didnt think "asd" is a valid domain it is a valid DNS name
-
flow
it's mapped to "asd." fwiw
-
bala
yes edhelas
-
bala
laravel
-
edhelas
bala laravel is mostly an async framework, good for rest and stuff like that
-
edhelas
if you want to do XMPP stuff in PHP there's not a lot of choices afaik
-
bala
okay edhelas thank you very much.
-
edhelas
where do you want your XMPP connection to sit ? server side or browser side ?
-
bala
edhelas need both
-
edhelas
🤔
-
bala
We need to integrate chat feature on our mobile app.
-
bala
How can we get started with XMPP?
-
edhelas
what is your mobile app architecture ?
-
bala
We are going to have iOS and android apps. What do you mean by architecture in specific?
-
edhelas
well, so two native apps, with a REST backend ?
-
bala
Yes,Its a Rest backend
-
bala
the app is an enterprise one, with different types of users.
-
bala
We need to enable chat among users.
-
edhelas
and the android app and ios app are writen in Java/Kotlin/Swift/ObjectiveC ?
-
bala
Yes, exactly. Java for Android and Swift for iOS
-
edhelas
well, then I advise you to use native Java and Swift XMPP libraries then :)
-
edhelas
you'll have to figure out how to create accounts/authenticate them in sync with your REST accounts ones
-
bala
Well.We need to integrate XMPP on our backend, right?✎ -
edhelas
why ?
-
bala
Well.We need to integrate XMPP on our backend, right? ✏
-
edhelas
is you backend connecting with other XMPP servers ?
-
edhelas
what is the goal of XMPP here for you ?
-
bala
nope. We need an XMPP server which can be used for iOS and Android apps, right
-
bala
For user creation, maintaining chat history and all
-
bala
how can we configure our XMPP server?
-
edhelas
so this xmpp server will be standalone, and it's only for those app users to communicate together
-
edhelas
then you setup the XMPP server next to your REST app, with ejabberd you can create/configure accounts using their internal REST API directly https://docs.ejabberd.im/developer/ejabberd-api/
-
edhelas
and you add a native XMPP lib in your mobile apps to connect to those accounts
-
edhelas
the only big thing I see is to figure out how to authenticate properly using server generated accounts
-
bala
okay thank you very much edhelas
-
sonny
on the backend, you can use ejabberd with https://github.com/processone/ejabberd-contrib/tree/master/ejabberd_auth_http or an other xmpp server supporting some kind of similar integration
-
edhelas
sonny 👍
-
sonny
edhelas 👍
-
lovetox
so domain.org is a bare jid?
-
jonas’
lovetox, yes
-
jonas’
domain.org/foo is a full-jid
-
lovetox
ok do we have a name for localpart@domainpart ?
-
jonas’
that’s also a bare jid
-
lovetox
yeah, but library wise, if i want to test for localpart@domainpart, what would i call that method
-
lovetox
is_bare_with_domain sounds a bit long
-
jonas’
has_local_part?
-
jonas’
(what do you need that test for, anyway?)
-
Zash
And http://www.example.com/ is a horror (host="xmpp:",resource="/www.example.com/")✎ -
lovetox
that does not exclude that it has a resource part..
-
Zash
And http://www.example.com/ is a horror (host="http:",resource="/www.example.com/") ✏
-
lovetox
sometimes for example for bookmarks
-
jonas’
what do bookmarks have to do with that?
-
lovetox
it makes no sense if a jid as a resource, or is only domainpart
-
lovetox
a bookmark should be localpart@domainpart
-
jonas’
why?
-
lovetox
because thats how it is, only domain can not be a room
-
lovetox
and resource describes a certain resource
-
jonas’
that’s wrong
-
jonas’
a domain can be a room
-
Zash
XEP-0045 forbids it IIRC?
-
lovetox
Each room is identified as a "room JID" <room@service>
-
jonas’
either way, I don’t think it’s the job of clients to enforce that, unless it makes things more complicated to *not* enforce it
-
jonas’
and I think in this case, it might be more complicated to enforce it that not enforcing it
-
lovetox
as i said i was talking from a library standpoint
-
lovetox
i just wanted a name for a property that reflects that this
-
jonas’
I was curious and asking because I haven’t had use for such a property yet
-
jonas’
I think I’d just use jid.is_bare and not jid.has_localpart or something like that
-
jonas’
it seems like a rare use case
-
Zash
is_bare := not has_resource ?
-
lovetox
yeah, thats what i was using, just was curious if there is a technical name for that
-
Zash
or .. :-?
-
lovetox
but it seem it is not
-
jonas’
Zash, yes
-
flow
lovetox, here are the terms that jxmpp uses: https://github.com/igniterealtime/jxmpp#jxmpp-jid beware, you may not like them
-
flow
http://jxmpp.org/releases/1.0.1/javadoc/org/jxmpp/jid/Jid.html has some examples
-
lovetox
thanks flow
-
pep.
jid-rs uses only FullJid and BareJid (and Jid { Full(FullJid), Bare(BareJid) })
-
flow
pep., then your API methods can't express that they require a full jid with localpart as argument, right?
-
pep.
Not for the moment no, because we haven't found a place where it's necessary yet
-
pep.
But also the xmpp library on top isn't really much used..
-
flow
> because we haven't found a place where it's necessary yet MUC room addresses?
-
pep.
I don't think it's necessary there
-
pep.
I don't really want to enforce this weird restriction
-
flow
(that was bascially one the motivation behind jxmpp's jid types)✎ -
flow
(that was bascially one major motivation behind jxmpp's jid types) ✏
-
flow
which weird restriction?
-
flow
bbl
-
pep.
flow, I'm not sure why there should be a MUC component on top of a room, for example. You can disco the room itself and be just fine
-
pep.
(that is, not sure why you'd require a localpart to a room)
-
jonas’
I also think that semantically, there is little difference between foo@bar and bar
-
jonas’
not enough to enforce it on the type system level anyways
-
pep.
yeah
-
pep.
When I got xmpp.rs I wanted to have both chat@xmpp.rs (MUC room) and bot@xmpp.rs (user account, and other accounts), because it's cool and I don't see why I shouldn't be allowed to. And while it's technically possible I've seen pain around chat@dino.im and.. :x
-
pep.
Technically it's only really an issue for me operator. there's no issue as long as I control what gets into this namespace (xmpp.rs)
-
pep.
Note that this is not exactly the issue described above, but it's the kind of things that people are afraid to do because it doesn't fit exactly what the protocol mandates for weird reasons
-
jonas’
well, there is a reason why that doesn’t work
-
jonas’
or why it’s painful
-
jonas’
it boils down to "how should clients discover rooms"
-
jonas’
the written-down protocol is that it queries via disco#items and disco#info until it finds a MUC service associated with a domain, and then it uses disco#items to find rooms
-
jonas’
subdomains are cheap, hence there’s no problem with that
-
pep.
"it boils down to "how should clients discover rooms" < that feels like UX straight from the 90s
-
pep.
with /list
-
jonas’
all of MUC is UX from the 90ies
-
pep.
Yeah, so by nowadays' standards some things are weird :)
-
jonas’
fair enough
-
pep.
It's not like xmpp.rs was going to host real users anyway, mostly utilities or contributors. You don't end up on chat@xmpp.rs because you found it with /list :p
-
pep.
Same for dino.im really
-
jonas’
"not real users […], mostly […] contributors"
-
pep.
Welll, only a few select, not like, users you want to give proper care to because they don't understand anything to the protocol :)✎ -
Zash
Will clients refuse to talk to user@host if host advertises the muc feature?
-
pep.
Welll, only a few select, not like, users you want to give proper care to because they don't understand anything about the protocol :) ✏
-
pep.
jonas’, we all know developers are not real users
-
jonas’
Zash, I hear that poezio does strange things w.r.t. muc feature
-
pep.
Look at their clients
-
jonas’
pep., hah
-
pep.
hmm I think the thing has been fixed in poezio(?)
-
pep.
Ah wait, no I don't remember anything about this
-
pep.
There was stuff related to carbons and muc lately but that's about it
-
pep.
(because detecting PMs is meh)
-
jonas’
yeah, that was based on disco#info on the domain (incorrectly)
-
pep.
yes
-
pep.
Exactly this :)
-
pep.
The one place I'd see requiring a MUC service is when a client wants to create new rooms
-
Wojtek
quick question - should we be concerned with lenght of the stanza id? from what I gather schema doesn't limit it...
-
pep.
I think it's profanity that has immensely long IDs. Some kind of HMAC iirc
-
jonas’
Wojtek, there is no specified limit beyond the limit of th eoverall stanza
-
jonas’
I suggest to limit it to 1023 utf-8 bytes (or codepoints, if that’s easier for you) if you have to place a limit
-
jonas’
it’s the same limit as resource and localpart have
-
Wojtek
yeah, but that's not specified, and someone may decide well I wannna have longer IDs. would have been nice to have this in the specs IMHO
-
Wojtek
> it’s the same limit as resource and localpart have yeah, that seems reasonable
-
pep.
Which spec?
-
pep.
6120?
-
jonas’
Wojtek, yeah, it would be nice to have a limit written down in '6120
-
Wojtek
yup
-
marmistrz
> https://github.com/legastero/stanza mayhaps thanks!
-
flow
> When I got xmpp.rs I wanted to have both chat@xmpp.rs (MUC room) and bot@xmpp.rs (user account, and other accounts) I also like that, but I don't see how this is related to a MUC address being a bare jid with a localpart
-
flow
Wojtek> yeah, but that's not specified, and someone may decide well I wannna have longer IDs. Then you should be worried about pub sub item IDs and (pubsub/xep30/…) node name length too
-
Zash
Just say 1023 octets
-
Zash
like JID parts
-
flow
Zash, note sure that simply saying it helps if we don't specify it
-
Zash
Someone once mentioned this issue wrt 'node' in disco and/or pubsub
-
flow
we could start with recommending size limits for xep359 IDs, pubsub item IDs, and node names✎ -
flow
we could, at least, start with recommending size limits for xep359 IDs, pubsub item IDs, and node names ✏
-
Zash
and lack of normalization specs
-
flow
a lack of unicode normalization specs?
-
Zash
yes
-
flow
aren't there like, a dozen of them
-
Zash
I mean, for stanza ids, nodes etc
-
flow
apply NFC and ensure that length in codepoints is less than X?
-
Zash
for example
-
flow
leaves the question what X sould be
-
Zash
1023 octets!
-
flow
is there an argument for less?
-
flow
where do 1023 come from anyway?
-
Zash
The parts of a JID
-
flow
(i know it's in the jid rfc, but where does that come from?)
-
Zash
🤷
-
Zash
historical raisins?
-
flow
so cargo cult at its finest
-
Zash
I prefer to call it Consistency
-
Zash
You could also argue that the limit should be 37
-
flow
sure, and if nobody comes up with an argument that the limit should be different, i'd also go with conistency
-
Zash
which iirc is the size of the textual form of an UUID
-
flow
but I could imagine that database people may have a strong feeling about the length of the primary key type
-
Zash
In the case of MySQL it's 20
-
Zash
Or 700 something.
-
flow
37 seems to low, at least for node names and item IDs, as these are sometimes used to carry a little bit of text with them
-
Zash
are node names meant to be human-readable?
-
Zash
If so then fun concerns apply
-
flow
duno, but there where at least two people who worked on a filesystem in pubsub
-
flow
so it does not appear to be far fetched that node names are user entered strings
-
flow
in some use-cases
-
flow
and we don't want to be the DOS of instant messaging
-
flow
cmon, no one?
-
Zash
Filenames on Linux are limited to 256 octets
-
Zash
... and can contain arbitrary binary except NUL and '/'
-
Zash
Or just ignore the whole thing and if you need to store arbitrary-sized IDs in your database you jam them trough a hash function
-
flow
sure, but meh
-
jonas’
effectively what jabbercat does
-
jonas’
because of the aforementioned limit