-
allie
hi all :) this might be a silly question... but I'm playing around with trying to write a component (or something to that effect). anyway, is there any guidance/suggestions on when something should be a component and when it should be client/bot?
-
allie
trying to figure out how all this stuff sorta fits together
-
Daniel
allie, as a matter of fact i did write something on that: https://github.com/xmpp-docs/simple-muc-component-java/blob/master/README.md
-
Daniel
the rest of the tutorial isn’t done. but the client vs component section is
-
pep.
How would I know I've received a directed presence from someone?
-
pep.
I start receiving presences from somebody not in my roster? that's it?
-
pep.
when do I stop receiving directed presences? What does the sender need to do? Send an unavailable presence?
-
lovetox
yes
-
pep.
ok
-
lovetox
hm but i dont know what the server actually does
-
lovetox
if i send a directed presence, does the server then route all my status changes to that contact from that moment on?
-
pep.
I guess so?
-
lovetox
or is it like i have to take myself care of all directed presences
-
lovetox
but what if i send a contact a different show/status then my other contacts
-
lovetox
this is totally a use case
-
lovetox
maybe Zash knows ^
-
Zash
You get to do presence broadcasts manually for directed presence.
-
pep.
Ah
-
pep.
hmm so there's less privacy issues than I though✎ -
pep.
hmm so there's less privacy issues than I thought ✏
-
pep.
I thought the server would actually forward all my status changes etc.
-
lovetox
yeah what i thought, everything else would not work
-
lovetox
one of the usecases for directed presence is, that i can show a different status/show to a contact
-
lovetox
so this would no fly if the server just broadcasts all my status changes
-
pep.
For me here it's the PEP updates use-case. I'm trying to come up with an update on that thread
-
lovetox
i didnt really get that, you want notifications from a contact not in your roster?
-
pep.
https://mail.jabber.org/pipermail/standards/2019-August/036367.html that's the thread, and yes
-
pep.
I'd want to allow people who can see my presence after me sending a directed presence, receive PEP updates for nodes they've expressed an interest for (+notify), for items with access_model=open
-
pep.
Hmm, that means I also need to have the other side's presence though no? :/
-
pep.
To get the caps
-
lovetox
not you
-
lovetox
the server
-
lovetox
and he can always query the contact if he needs to
-
pep.
Are caps available to anybody who asks?
-
lovetox
yes
-
pep.
ugh
-
lovetox
i mean depends on your client, a client could as well not answer a disco info request
-
pep.
You can ask a barejid no?
-
pep.
Or always fulljid?
-
lovetox
i guess you can ask a barejid
-
lovetox
but you will always get a answer from a fulljid
-
lovetox
in the contact case
-
pep.
You'll get an answer from a random fulljid?
-
lovetox
no you cant get an answer from a fulljid
-
pep.
> lovetox> but you will always get a answer from a fulljid
-
lovetox
server will always add a from with a resource
-
lovetox
ah sorry
-
lovetox
thought about barejid
-
lovetox
yes probably from all fulljids currently online
-
lovetox
or do IQs to contacts always need to be to fulljid?
-
lovetox
i dont know the routing rules
-
lovetox
where does a server route a IQ with no resource
-
lovetox
could be he doesnt at all
-
pep.
Ok that'd be what I expect I guess. Bob sends directed presence to Alice, requests Alice's caps on the barejid, it happens one of Alice's devices has foo+notify, and Bob has a foo node with open items
-
pep.
So Bob's server pushes that to Alice
-
lovetox
Zash ^
-
lovetox
but pep. i think you get yourself in a very complex situation that will not work good all the time
-
lovetox
its easier to just add the contact to your roster
-
pep.
Yeah that won't happen :x
-
pep.
Not for me at least
-
lovetox
so how long do you send directed presences?
-
lovetox
say you have a convo with a contact not in your roster
-
lovetox
you do your presence thing
-
lovetox
now you restart your client, what now?
-
pep.
Yeah, read the thread on standards, that's also one of my questions
-
lovetox
again sending directed presence? for how long goes that on? until the end of time?
-
Daniel
the end of the session
-
pep.
Sure, probably
-
lovetox
Daniel why though? one can argue that the chances of a device switch within a session is near zero
-
lovetox
you dont need notifications for that
-
pep.
Except when it's not
-
pep.
And then you get users complaining
-
lovetox
yeah sure, getting notifications only until you restart your client once, sounds like its surley work fine
-
pep.
As I don't add people in my roster that easily I suspect it'll be the case for me as well
-
lovetox
what you need is a local roster
-
lovetox
local roster of contacts which are not in your server roster
-
Daniel
pep., but why are you fine with having your client (automatically) send directed presence for all open conversations but not simply asking for mutual presence sub?
-
lovetox
then you can delete a contact from your local roster once you dont need him anymore, and can stop the presence thing
-
pep.
Daniel: it's not permanent right?
-
pep.
I can close the tab and be done with it
-
Daniel
if privacy is a concern (which i get but might not share) subbing to pep seems like the only option
-
lovetox
yeah why send directed presence, and not just sub to the node?
-
lovetox
those subscriptions you could track and manage
-
pep.
Not sure yet.
-
pep.
lovetox: tracking-wise it's the same
-
pep.
I need to know when to unsubscribe, same as I need to know when to send unavailable
-
lovetox
as i suggested make something like a local roster
-
pep.
Sure, that's an implementation detail
-
lovetox
then you know for all contacts in that local roster you can do X
-
lovetox
like sub on start of the session
-
lovetox
or send directed presence
-
lovetox
but you thought that only through into one direction
-
lovetox
if you want to send messages
-
lovetox
but the other way around will break easily
-
lovetox
only if you send someone your presence, it does not mean he gets updates when you change your devices
-
lovetox
or does it Oo?
-
pep.
When to subscribe is fine I guess. When to unsubscribe is a bit more annoying but also doable. When tab closes, on disconnect, and later when seeing a foreign PEP update
-
lovetox
no i dont think so
-
pep.
No it's not a thinf✎ -
pep.
No it's not a thing ✏
-
pep.
I was going to maybe change that in PEP, just trying to see if it's worth it or not
-
lovetox
still see no benefit in this solution, i just add a contact to my roster and delete him if i dont want to talk anymore
-
lovetox
thats 2 clicks
-
lovetox
and zero implementation work
-
pep.
It's a bit less of a bother for a client to just send a directed presence I guess
-
pep.
Sure you still have to track who you're sending to
-
pep.
And you go through roster subscription flow and that's quite a pain for the user
-
lovetox
no you are trying to implement a solution that will not work 100% of the time, and needs code changes in your client, and i heard no gain sofar
-
lovetox
then make the roster subscription flow easier? actually it should just be one click
-
lovetox
there is no need to bother the user with more
-
Zash
So much text
-
pep.
Then you need to go to your roster when you're done and delete it :x
-
Zash
lovetox [13:14]: > i guess you can ask a barejid you can't
-
pep.
Brb
-
pep.
That's annoying
-
Daniel
i mean both managing directed presence and managing pep subscription seem like a pain in the ass
-
Daniel
however one of those is available now without changes to the XEP
-
Daniel
and to servers
-
lovetox
pep. then add something so its not annyoing
-
lovetox
like a button "Add contact temporary to roster"
-
lovetox
which means the client will delete it automatically from the roster after X days
-
lovetox
or at the start of the next session
-
lovetox
seems much nicer to go the direction of automating this adding/deleting roster stuff
-
Daniel
well there is also an alternate universe where roster means 'open conversations' (and not phone book)
-
Daniel
that then would also act as a way to sync 'open conversations'
-
Daniel
and you wouldn’t publish you entire 'address book' to the server but only 'open conversations'
-
Daniel
so if you close a tab you remove that person from the roster
-
pep.
When do we finish that inbox xep
-
pep.
Ok so.. conclusion, we manually subscribe to PEP and that's it?
-
Ge0rG
lovetox: never touch my roster without asking me. It's *my* roster, not yours.
-
Ge0rG
pep.: BTW, how do you synchronize that state between multiple clients?
-
pep.
You don't? Every client does its own magic :/
-
pep.
Not that I wouldn't like to have that
-
pep.
That's an interesting question though
-
Ge0rG
If only we had account side pep subscription management
-
Daniel
the second half of my Quicksy talk was about all that
-
Daniel
nobody cared back then :-)
-
pep.
Alice receives a message from Bob (who isn't in her roster) on her mobile and her desktop at the same time. She sees the message on the desktop but closes the tab and takes the discussion on the mobile because she's moving.
-
pep.
What do I do now.. One device will probably unsubscribe PEP, the other still needs it
-
Daniel
https://github.com/iNPUTmice/talks/blob/master/2018_11_14_-_the_making_of_a_new_feature.md#to-roster-or-not-to-roster
-
Daniel
i mentioning that because i already went to the thought process
-
pep.
Daniel, with multiple devices I'll have the same issue as bookmarks though..
-
pep.
I don't have the same usage of my phone and poezio :/
-
pep.
And then it's useless again
-
Daniel
true
-
pep.
Unless the XEP has profiles etc., but I doubt we'll go that way
-
pep.
Also if you use that XEP with a device and then you forget about it, you'll be subscribed to all the open discussions for eternity :p
-
pep.
(with profiles)
-
pep.
Currently, if we choose to subscribe to PEP manually, I see easy fails with multiple devices as I mentioned above
-
pep.
One will subscribe, you'll receive a notification, another one will unsubscribe because they don't know who that's coming from, etc.
-
Daniel
you can probably sub with your full jid to avoid that
-
pep.
hmm
-
pep.
That's handled by your server then? Or do all these queries get to the recipient's server?
-
Daniel
but also direct sub will only nofiy you when the change occurs while you are online
-
pep.
(As in your server subscribes for you with your barejid, and only sends to the subscribed fulljib)
-
pep.
True
-
Daniel
or we put that in MAM :-)
-
pep.
:/
-
pep.
What don't we put in MAM nowadays
-
Ge0rG
MUC.
-
Daniel
Only speak for yourself
-
pep.
I want to say <presence/> :-°
-
Zash
Chat states in presence?
-
Ge0rG
Chat states make up a frighteningly big part of my MAM download
-
Zash
What
-
Zash
I remember that being the case, so I made mod_mam strip them by default (+ configurable whatever namespaces)
-
Ge0rG
Zash: also empty messages from jitsi that only contain a thread
-
Ge0rG
Zash: I'll run another sync job and give you the Smack class names of the elements in body-less messages
-
Zash
Ge0rG: Does it send it like that?
-
Zash
thread + chat-state I can believe, but only thread? wut
-
Ge0rG
Zash: all I have is MAM
-
Ge0rG
Somebody broke the xml log in poezio, and android hardly remembers the last half an hour
-
pep.
Ge0rG, it's back on master
-
pep.
For 2 weeks now
-
Ge0rG
pep.: that's less than my poezio uptime.
-
Ge0rG
Since we fixed the memory leak, there are no excuses left for restarting. Okay, actually there's one left, when my ISP fails and then the automatic reconnect fails as well.
-
Zash
Why are there carbons in my archive?
-
Zash
35% of all xmlns attributes are chat states
-
Ge0rG
Zash: reduce your carbon footprint!
-
Ge0rG
As opposed to Carbons, MAM won't tell you if a message is outgoing or incoming. This is a real consistency problem with self messaging.
-
Zash
but https://hg.prosody.im/trunk/rev/93a068ef4b2c
-
Zash
Most of them are from before that tho
-
Ge0rG
Zash: how is this possibly a thing that a server operator would want to care about?
-
Zash
How am I supposed to know beforehand what should be archived and what shouldn't?
-
Ge0rG
Read all the XEPs. Make informed decisions. Bitch on standards@.
-
Zash
And then things change again.
-
Ge0rG
Zash: you can't have config variables for all the things that might change.
-
Zash
The list of plugins is the ultimate config variable for all things that will change.
-
Ge0rG
And you have SCM for the code, with one central repository. Imagine thousands of server admins trying to keep up with the latest and greatest value for each config variable.
-
Ge0rG
mod_mam_smart?
-
Zash
Actually it should just store everything and then do filtering when you query.
-
Ge0rG
Please don't.
-
Zash
And whatever happened to chat states in presence?
-
Ge0rG
It should do filtering based on the advertised client features, yes, but it really shouldn't store ephemeral junk like chat states
-
Ge0rG
Zash: nothing yet
-
Ge0rG
Zash: write the XEP!
-
Zash
My own server strips receipts, chat markers, hints, .... fight me.
-
pep.
Right, you don't need hint to store in MAM once they're in MAM. Shouldn't that be the default? :p
-
pep.
(not to store them)
-
Zash
Strip chat states. Realize archive is 90% chat markers. Strip those, etc.
-
Zash
Ask for 50 messages, get two with actual content.
-
Zash
Much fun.
-
Ge0rG
Zash: receipts and markers actually make sense
-
pep.
Zash, do you also not store messages that are empty after you've stripped things?
-
Zash
pep., yes, that's how it knows there wasn't anything useful in them
-
pep.
k
-
Zash
And why a message with only a <thread> could make it in there, if it also had a chat state
-
Ge0rG
Zash: why don't you store the unstripped version if the stripped one isn't empty?
-
Zash
Smaller storage footprint?
-
Zash
Less data to send when you query
-
Ge0rG
Alright
-
Ge0rG
Just that you might end up with only a thread element in MAM
-
Ge0rG
And you shouldn't completely strip that out
-
Zash
What would you do do with a thread and a chat state?
-
pep.
You should have a smarter module and remove stuff that doesn't make sense anymore once you've processed all you wanted to remove :P
-
Zash
I should say patches welcome.
-
pep.
:)
-
pep.
post_post_process_messages
-
Ge0rG
mod_aggregate_receipts_and_markers
-
pep.
mod_mam_plus
-
Zash
Isn't that the great plan already? MAM2
-
pep.
Not mam:2 right
-
Zash
No
-
Zash
MAM reimagined as some sort of multidimentional magic thing where each message has its own archive of addon-data
-
pep.
Yeah I know. Andrew Nenakhov even ranted about that on standards yesterday?
-
Zash
Hm? I'm referring to last Summit discussions
-
Zash
No wait, not an archive per message. An archive per extension per message.
-
pep.
Yeah, that was also discussed a few days ago in xsf@, alongside fastening
-
Ge0rG
Also summaries of attached messages
-
Ge0rG
<message type='chat' xml:lang='en' to='georg@yax.im/yaxim' id='7c0c163405834bfdb605eaf09333caa3' from='poezio@muc.poez.io/occupant'><origin-id id='7c0c163405834bfdb605eaf09333caa3' xmlns='urn:xmpp:sid:0'/><x xmlns='http://jabber.org/protocol/muc#user'/></message>
-
Ge0rG
Zash: I end up with more worthless messages in MAM: ^
-
Ge0rG
Zash: you can't strip <x/> or <origin-id/> from stored messages, but you can ignore them for the sake of storing messages.
-
Ge0rG
Zash: so you need that split-logic after all
-
Zash
Doing other things and/or nothing today. Please open an issue and write down the requirements, without mixing in different issues.
-
allie
Daniel: thanks for the link :) Although I'm still not 100% clear on when one should implement one or the other, unless the component is adding additional XEPpy features to the server. In those cases it seems it makes perfect sense. I guess it's a little confusing since, in the past, people have created components for things that didn't really need components.
-
allie
I just want to write something that provides weather information to me and other users when requested. That seems like it'd be in bot territory, since it doesn't need to modify JIDs, isn't extending the server, etc.
-
Ge0rG
allie: then write a bot
-
allie
yeah prolly what I'll do
-
allie
most of that was kinda thinking outloud :)
-
Ge0rG
You make a component if you want to bridge to a different chat network
-
allie
right, or I guess maybe pubsub-type stuff.
-
pep.
Ge0rG, that's not the only use-case, definitely.
-
pep.
You make a component if you need another addressing namespace(?)✎ -
pep.
You make a component if you need another addressing space(?) ✏
-
Ge0rG
Is there a reason to do pubsub on a component instead of on a bot?
-
Ge0rG
pep.: yes, that's the abstract way to say it. But where else do you actually need that?
-
pep.
I guess a component is also easier to bundle with the server usually
-
pep.
You could very well have a pubsub bot running on the server? :p
-
allie
or like I was saying earlier if you're extending server functionality with another XEP
-
pep.
Ge0rG, though, a bot wouldn't appear in the server's disco#items would it?
-
pep.
Maybe not impossible to add it there.
-
allie
I've been an xmpp user off and on for years. but never tried to make anything for it. so that's why I'm still feeling my way through the different parts, and if you're going by how others have implemented things, I guess they've sometimes implemented things in certain ways that may have been better in other ways
-
Ge0rG
pep.: ask jonas’ if you really dare
-
pep.
:D
-
pep.
allie, sure some ways might be more appropriate than others :)
-
pep.
Ge0rG, just like you can have a MUC component on a barejid? :)
-
Ge0rG
pep.: yes.
-
Zash
Aha, found the post I was reminded of: https://metajack.im/2008/08/04/thoughts-on-scalable-xmpp-bots/
-
pep.
So why would you make a component if you don't need the addressing space?
-
pep.
Can you call a component that doesn't make use of that space a bot?
-
Zash
You can call it whatever you want, it's all arbitrary anyways
-
allie
I guess it's more that clients have lots of baggage that may not be appropriate for a component, whereas a component may as well be an entirely separate xmpp server that manages all its own stuff internally
-
pep.
Zash, not sure why the roster would be a problem at all. Just don't use it? :/
-
pep.
The component still needs to keep a mapping anyway
-
Zash
You can cheat if you do it yourself
-
pep.
Right
-
pep.
Also nothing says a component has to have only one role, right?
-
pep.
(That is, MUC, pubsub, user domain?!, etc.)
-
pep.
mod_pubsub could even be loaded on the vhost right?
-
Zash
Remember the special user@host component thing Prosody supports?
-
Ge0rG
pep.: some client libraries seem to have very strong opinions on that
-
pep.
Ge0rG, open bugs!
-
Zash
pep., as long as they don't conflict in the namespaces and stuff they use. Eg disco gets funky sometimes.
-
Ge0rG
pep.: BTDT
-
pep.
hmm right disco
-
pep.
I would have liked this <feature><feature/></feature> thing to happen :P
-
Zash
pep., but you're right, there's no problem with having pubsub and stuff on a normal host. MUC is problematic tho, since it overloads nodeparts
-
pep.
yeah
-
pep.
But I'm sure users and rooms can coexist. They can find a way to live in peace
-
Zash
Why can't users be rooms? And why can't rooms join users?
-
pep.
Such a philosophical question
-
Zash
Like DMUC (?) where MUCs join other MUCs and you get IRC-style trees
-
pep.
I was actually planning to look into that
-
pep.
That is, adding it on the TODO
-
Ge0rG
A client needs different code paths for messages from a MUC vs from a user. You can't have both on the same bare JID
-
allie
Zash: MUCs all the way down...
-
pep.
A room cannot be on a FullJid right? Otherwise there's no place for nicks anymore(?)
-
Zash
Correct