Implement XEP-0060 temporary subscription#64
Implement XEP-0060 temporary subscription#64denisw wants to merge 6 commits intobuddycloud:masterfrom denisw:tempsub
Conversation
Clients can now send a Pub-Sub <options/> IQ and set 'pubsub#expire'='presence' as described in http://xmpp.org/extensions/xep-0060.html#impl-tempsub
|
If we are altering the original schema, the database will need to keep a http://blog.cherouvim.com/a-table-that-should-exist-in-all-projects-with-a-database/ Please add this to your pull request. On 9 July 2012 20:09, Denis Washington <
Simon Tennant | buddycloud.com | +49 17 8545 0880 |
|
Yes. We need some safe way to upgrade the DB schema. Something like adding a At first it could just tell the user to run the upgrade scripts manually; maybe later we can make the upgrade automatic. |
|
Other than that, your patch looks good! (Maybe just replace |
|
If you like the DB schema version to be part of the pull request, I'll try to add that to the pull request today. @Schnouki I did test the changes; otherwise I would never come across the idea to make a pull request. :) Using some test code that subscribes to a node, makes the subscription temporary and logs out, I could verify with psql that the subscription was marked temporary and was deleted afterwards. (And, naturally, that only that subscription was deleted.) |
|
@denisw Great :) A few more issues and questions:
(Don't hesitate to ask if you need help for any of these!) |
|
From my testing, it seems that the webclient uses |
|
@Schnouki I fixed two of the issues you listed in your last comment, but have questions about the other two:
|
|
Are you sure about Which raise another issue: remote servers must know which subscriptions are temporary so they can do the same filtering with their clients. I think we should also only allow temporary subscriptions if both the subscription request and the Suddenly temporary subscriptions seem much more complicated to do :) |
|
This means the only way to make a temporary subscription is to put a <options/> query next to a <subscribe/> one in the same IQ.
|
@Schnouki I tied making a subscription temporary to the As to notifications: do remote servers need to know about temporary subscriptions? If not, it might be a good idea to avoid the notifications completely in this case. |
|
Yes, remote servers do need to know about temporary subscriptions: they will only send PubSub notifications to servers they know about. If test.com does not know that a user from example.net has subscribed to whatever@test.com, it won't send PubSub notifications to example.net when something happens in the whatever@test.com channel. So at the very least they need to know about subscriptions. |
|
The problem I see is that there doesn't seem to be any standard way of notifying Pub-Sub servers of subscription options. I guess if we want to federate the temporary status, we need to invent some new |
|
Right. We could just add a |
|
We also probably need to add it to items in */subscriptions nodes: ...but this would expose temporary subscriptions to clients (which should use this anyway). |
|
@denisw I think this is becoming too complicated to do everything in a pull request :) I started a wiki page (on bc.org) so we can design it correctly: https://buddycloud.org/wiki/Buddycloud_server_WIP. Feel free to contribute there. |
|
@Schnouki I agree with (and have implemented) most of what you have written on the wiki page, but still have some questions / concerns. I added a "Discussion" section to the page for this. |
|
Implemented in e84c384 and following commits; will be merged soon. Thanks for your help, code and input! |
|
Excellent work. Thanks @Schnouki |
Adds support for marking a Pub-Sub subscription as temporary (see http://xmpp.org/extensions/xep-0060.html#impl-tempsub). Such subscriptions are removed as soon as the client goes offline.