Projects tigase _server server-core Issues #399
Allow to inject a full Element instead of just a custom status (#399)
Daniele Ricci opened 10 years ago
Due Date
2016-01-21

This patch allows the RosterFlat implementation to inject a delay element inside presence stanzas with the last seen timestamp.

This breaks APIs I'm afraid, unless we want to keep the old getCustomStatus method and behaviour to work together with the new getCustomChild.

For this reason, this is probably an unwanted patch, but I'm submitting it anyway because I'd like to have your feedback and eventually modify it to be included in the source tree.

0001-Allow-injection-of-custom-child-element.patch

Artur Hefczyc commented 10 years ago

I do not see any patch attached. Did you forget to attach it? To be honest I do not understand it's purpose but maybe once it is attached I can deduct from the code.

Daniele Ricci commented 10 years ago

Artur Hefczyc wrote:

I do not see any patch attached. Did you forget to attach it? To be honest I do not understand it's purpose but maybe once it is attached I can deduct from the code.

Don't worry, nobody has these kind of powers :) I forgot to attach the patch, sorry.

Artur Hefczyc commented 10 years ago

Daniele, I guess you are OK with the source code disclaimer in this case as well?

By not understanding purpose of the patch, I meant that the description is not clear to me.

Daniele Ricci commented 10 years ago

Artur Hefczyc wrote:

Daniele, I guess you are OK with the source code disclaimer in this case as well?

Absolutely.

By not understanding purpose of the patch, I meant that the description is not clear to me.

Oh, ok :)

Artur Hefczyc commented 10 years ago

Accepted source code disclaimer on behalf of Daniele following his comments.

Wojciech, please take a look at the patch and consider including it into our source code.

wojciech.kapcia@tigase.net commented 10 years ago
  • applied the patch;

  • given it's more in line with specification (v. XEP-0203: Delayed Delivery) I've enabled it's inclusion by default (still can configure list of clients or turn it off with @sess-man/plugins-conf/presence/offline-roster-last-seen=off@)

  • while at it and based on our previous discussion I've removed unused RosterElementIfc interface;

  • cleaned up empty javadocs.

Daniele Ricci commented 10 years ago

Don't call me a pain :) but I think this can be expanded to use ExtendedPresenceProcessorIfc. What do you think?

My own need is to add a custom child to every presence, including unavailable presence coming from the roster. Do you think it's better to modify RosterAbstract.getCustomChild to return an array/list of children (I could extend RosterAbstract then) or use an ExtendedPresenceProcessorIfc? I can write a patch, but I'd like to hear your opinion first. Thanks.

Artur Hefczyc commented 10 years ago

I did not review the code and topic well enough to comment on this. I leave a decision about it for Wojciech.

Andrzej Wójcik (Tigase) commented 9 years ago

I was forced to disable offline-roster-last-seen as it was messing up (see #3463) and causing additional processing due to fact it generates offline presences for every one in users roster, even that some users are online (but our server will know it that after presence probe). So this features causes for online users from roster to generate presence offline followed by presence online packets.

Daniele Ricci commented 9 years ago

Andrzej Wójcik wrote:

I was forced to disable offline-roster-last-seen as it was messing up (see #3463) and causing additional processing due to fact it generates offline presences for every one in users roster, even that some users are online (but our server will know it that after presence probe). So this features causes for online users from roster to generate presence offline followed by presence online packets.

I can't reach #3463 (forbidden). What was that about?

wojciech.kapcia@tigase.net commented 9 years ago

In principle what Andrzej has summarised - non-standard/against-RFC behaviour of sending unavailable presence prior to the actual presence.

wojciech.kapcia@tigase.net commented 9 years ago

Daniele Ricci wrote:

My own need is to add a custom child to every presence, including unavailable presence coming from the roster. Do you think it's better to modify RosterAbstract.getCustomChild to return an array/list of children (I could extend RosterAbstract then) or use an ExtendedPresenceProcessorIfc? I can write a patch, but I'd like to hear your opinion first. Thanks.

I've opted to modify RosterAbstract so now tigase.xmpp.impl.roster.RosterAbstract.getCustomChildren(XMPPResourceConnection, JID) is used with this particular feature an you can provide your Roster implementation with --roster-implementation system property.

I've chosen this approach because this feature is still experimental and as shown above - it breaks specification somewhat (sends two presence stanza when the contact is online.

I would say it's better to utilize feature implemented in commit:aaa344b7 and levarage mentioned ExtendedPresenceProcessorIfc to provide your custom elements in outgoing presence packets - it will be more in line with the specification of Presence Probe and handling unavailable presence:

If appropriate in accordance with local security policies this presence notification MAY include the full XML of the last unavailable presence stanza that the server received from the contact.

Daniele Ricci commented 9 years ago

Wojciech Kapcia wrote:

I've opted to modify RosterAbstract so now tigase.xmpp.impl.roster.RosterAbstract.getCustomChildren(XMPPResourceConnection, JID) is used with this particular feature an you can provide your Roster implementation with --roster-implementation system property.

Very well, thanks.

I would say it's better to utilize feature implemented in commit:aaa344b7 and levarage mentioned ExtendedPresenceProcessorIfc to provide your custom elements in outgoing presence packets - it will be more in line with the specification of Presence Probe and handling unavailable presence

I agree, I was probably too rush on writing code that way :) I will do some experiments with this new approach. Thank you!

Artur Hefczyc commented 9 years ago

I guess I can close the ticket now, let me know if you need to reopen it.

issue 1 of 1
Type
Patch
Priority
Minor
Assignee
RedmineID
2530
Version
tigase-server-7.1.0
Spent time
37h 30m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#399
Please wait...
Page is in error, reload to recover