Bug 45491

Summary: Show up <error><text> as status message for contacts with error presence
Product: Telepathy Reporter: Will Thompson <will>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 21839    
Attachments: Presence: show better error status messages.

Description Will Thompson 2012-02-01 03:57:10 UTC
My XMPP server is acting up and is failing to resolve really obscure domains like “gmail.com”. I only really noticed because the other IM client I use showed me the error message Prosody helpfully sent me (“Connection failed: DNS resolution failed”). Empathy just shows them with the Offline icon, but with no text (not even the word “Offline” or “Error”).

So, let's fix this.
Comment 1 Will Thompson 2012-02-01 03:58:17 UTC
Created attachment 56438 [details] [review]
Presence: show better error status messages.

When you get <presence type='error'>, any <status/> element in the
presence is an echo of a stanza you sent out. So the message in that is
not the contact's presence: it's either your status, or maybe the
message you sent with a subscription request, depending on whether we
got the <presence type='error'/> for a roster contact or someone we
tried to subscribe to.

So instead, I think we should use the text of the error (if any) as the
status for such contacts, falling back to the error element name if the
server is unkind and doesn't include an error message. Yes, this means
strings will show up in the UI in the server's locale, but this is
hardly news.
Comment 2 Simon McVittie 2012-02-01 04:14:29 UTC
Comment on attachment 56438 [details] [review]
Presence: show better error status messages.

Review of attachment 56438 [details] [review]:
-----------------------------------------------------------------

r+

::: src/presence-cache.c
@@ +43,4 @@
>  #include <wocky/wocky-utils.h>
>  #include <wocky/wocky-namespaces.h>
>  #include <wocky/wocky-data-form.h>
> +#include <wocky/wocky-xmpp-error-enumtypes.h>

You know you wanted <wocky/wocky.h> to be a metaheader? I'm still in favour of that :-)

::: tests/twisted/presence/error.py
@@ +63,5 @@
> +    type_, status, message = presences[hawk_handle]
> +    assertEquals(cs.PRESENCE_ERROR, type_)
> +    assertEquals('error', status)
> +    # FIXME: It might be less user-hostile to give some kind of readable
> +    # description of the error in future.

Certainly true, but without that fix this is still an improvement, so go for it.
Comment 3 Will Thompson 2012-02-01 04:47:17 UTC
Merged to master, thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.