Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Server-To-Client handler #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vduduh
Copy link

@vduduh vduduh commented Feb 28, 2020

@p1bot
Copy link
Member

p1bot commented Feb 28, 2020

Hi @vduduh, many thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

@p1bot p1bot added the cla-missing Contributor needs to sign Contribution License Agreement label Feb 28, 2020
@p1bot
Copy link
Member

p1bot commented Feb 28, 2020

You did it @vduduh!

Thank you for signing the ProcessOne Contribution License Agreement.

We will have a look at your contribution!

@p1bot p1bot removed the cla-missing Contributor needs to sign Contribution License Agreement label Feb 28, 2020
@remicorniere
Copy link
Contributor

remicorniere commented Feb 28, 2020

Hello vduduh and thanks for contributing !
As pings described in XEP-0199 are IQ stanzas, and not nonzas, I'd rather have them processed by the router instead, in this function :

func (r *Router) route(s Sender, p stanza.Packet)

Also, as the spec that you linked says, the client must only respond if it supports the ping namespace. For now, there is no way for the client to say that it supports this feature because responding to IQ requests is not supported (also, we don't support it). We would need to implement that first.

If you'd like to have a go at it, that'd be great ! :)

@vduduh
Copy link
Author

vduduh commented Feb 28, 2020

Hello @remicorniere !
Some servers force disconnection of clients if they do not respond to ping. That is why I implemented this functionality.

@remicorniere
Copy link
Contributor

I understand. Thank you for suggesting this change.

Although for now I believe the code edits were not made in the right place (see my previous comment).
You can edit your patch to implement the suggested adjustments. Please let me know if you have any questions or need guidance ! :)
Also please refer to the guidelines: we are missing tests for your new feature. Could you please add some ?

For now I will link this PR to an issue reflecting your feature request.
Thanks !

@remicorniere remicorniere linked an issue Feb 28, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support XEP-0199: Reply to client or server initiated Ping
3 participants