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

Profanity doesn't show error messages #1435

Closed
mdosch opened this issue Oct 30, 2020 · 4 comments
Closed

Profanity doesn't show error messages #1435

mdosch opened this issue Oct 30, 2020 · 4 comments
Assignees
Milestone

Comments

@mdosch
Copy link
Contributor

mdosch commented Oct 30, 2020

If a message is not delivered but an error reply is sent profanity doesn't show the error.
You can test this by writing to xmpp:[email protected] (an example of a stanza sent by [email protected] can be seen at psi-plus/main#788 )

Expected Behavior

The error message should be shown to the user.

Current Behavior

There is no indication that the message was not successfully sent.

Possible Solution

Environment

Debian Testing (Bullseye)

profanity -v
Profanity, version 0.9.5dev.master.15f45fcf
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2020 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.14.0-unknown)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.8.6)
GTK icons: Enabled
@jubalh
Copy link
Member

jubalh commented Oct 30, 2020

In _handle_error() we print the error message in the UI if it doesn't have a from_jid or is not of type cancel.
I didn't write that code and don't know all possible stanzas and what we want to do with them. But probably printing the err_msg in all cases might make sense.

Code: https://github.com/profanity-im/profanity/blob/master/src/xmpp/message.c#L825

If anybody knows more I'm eager to hear it.

@jubalh
Copy link
Member

jubalh commented Oct 30, 2020

14:31:43 - SENT:
14:31:43 - <message id="ZTA1N2E4YTQtMGNlMy00M2JiLWExODgtOWYyZDRhMzg1NTI0OTFkNTc5OGFhOGM2ZDdhZGMzZWZhM2YyN2ZhNTAwNzYwZTBmMmQ1MzcwM2VhYWVmNmE3NzI4Y2RlMjQ2YTg0ZA==" to="[email protected]"          
           type="chat"><body>hi</body><active xmlns="http://jabber.org/protocol/chatstates"/><request xmlns="urn:xmpp:receipts"/></message>                                                   
14:31:43 -                                                                                                                                                                                    
14:31:43 - RECV:
14:31:43 - <message id="ZTA1N2E4YTQtMGNlMy00M2JiLWExODgtOWYyZDRhMzg1NTI0OTFkNTc5OGFhOGM2ZDdhZGMzZWZhM2YyN2ZhNTAwNzYwZTBmMmQ1MzcwM2VhYWVmNmE3NzI4Y2RlMjQ2YTg0ZA=="                             
           to="[email protected]/profanity.r23S" type="error" from="[email protected]"><error type="cancel"><not-allowed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text                       
           xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Error handling test</text></error></message>       

@jubalh jubalh added this to the 0.10.0 milestone Oct 30, 2020
@jubalh jubalh self-assigned this Oct 30, 2020
jubalh added a commit that referenced this issue Oct 30, 2020
Regards #1435

So far we didn't print the error if it contained `<error
type="cancel">`. It appears that the code always thought this is a
service-not-available (so one is either blocked or the account doesn't
exist) and printed `Recipient not found`.

But there can be other errors as well. Like in above mentioned issue
`not-allowed`.

Let's just print the text.

In case of the cancel type we still remove the jid from the chat
sessions. I'm not entirely sure whether this needs to be done in other
cases too.
@jubalh
Copy link
Member

jubalh commented Oct 30, 2020

@mdosch should be better now. Please give feedback :)

@jubalh jubalh closed this as completed Oct 30, 2020
@jubalh
Copy link
Member

jubalh commented Oct 30, 2020

reply with nonexistent account:

15:01:18 - SENT:
15:01:18 - <message id="YzM4MGU2MGItOTI5ZC00NTkxLWJkZTktNDM4MGNhMTVjNjY2MDZjNzNiN2QzZDY1MmJlMz
           JlNjVjNzIxM2QzZDQ1YzJjMGFlMmQ3MjJmNjczM2JjOTk1NTRkYWYzYmE5MWE2Mw=="                
           to="[email protected]" type="chat"><body>hi</body><active                            
           xmlns="http://jabber.org/protocol/chatstates"/><request                            
           xmlns="urn:xmpp:receipts"/></message>                                              
15:01:18 -                                                                                    
15:01:18 - RECV:
15:01:18 - <message id="YzM4MGU2MGItOTI5ZC00NTkxLWJkZTktNDM4MGNhMTVjNjY2MDZjNzNiN2QzZDY1MmJlMz
           JlNjVjNzIxM2QzZDQ1YzJjMGFlMmQ3MjJmNjczM2JjOTk1NTRkYWYzYmE5MWE2Mw=="                
           to="[email protected]/profanity.r3cS" type="error" from="[email protected]"><error   
           type="cancel"><service-unavailable                                                 
           xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></message>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants