Bug 45491 - Show up <error><text> as status message for contacts with error presence
Summary: Show up <error><text> as status message for contacts with error presence
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 21839
  Show dependency treegraph
 
Reported: 2012-02-01 03:57 UTC by Will Thompson
Modified: 2012-02-01 04:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Presence: show better error status messages. (5.52 KB, patch)
2012-02-01 03:58 UTC, Will Thompson
Details | Splinter Review

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.