Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16552 closed defect (fixed)

Jabber connections constantly dis-/reconnect on Retina Macbooks due to avatar sizes

Reported by: Sonix Owned by:
Milestone: Adium 1.5.10 Component: Service/XMPP (Jabber)
Version: Severity: regression
Keywords: Cc: Adrian Godoroja
Patch Status: Accepted



After switching from an old macbook to a new one with retina display and using the exact same settings, accounts and pictures I was not able to maintain a connection to both of the jabber services I use (one private server and After looking at the debug log and googling I determined the size of the avatar picture was the cause. As I have used the same picture on the old macbook where everything worked fine there seems to be an issue with correctly resizing the picture to fit with the size constraints of the jabber servers.

Steps to reproduce

Detail the exact steps taken to produce the bug. Use the following format, each line with " 1." before it:

  1. Connect to a Jabber account on either or another server using ejabberd
  2. On a system with a retina display (HiDPI mode), set a sufficiently large avatar (mine was around 320x300px)
  1. observe constant reconnects

Expected results

Should set the new avatar and stay connected. If not possible automatically resize the picture so it fits.

Actual results

Disconnection from the server due to "policy violation" with instant reconnect-attempts by adium/libpurple


Tested: Adium 1.5.8 (stable) and 1.5.9b3 on OS X 10.9


Note: If this isn't an issue with HiDPI, then maybe adium should give warnings about why the connection failed and how to (propably) resolve it (i.e. change avatar size)

Copied from Adium Debug Log:

17:52:02: (Libpurple: jabber) Sending (ssl) ( <iq type='get' id='purple65359b31'><ping xmlns='urn:xmpp:ping'/></iq>
17:52:05: (Libpurple: jabber) Recv (ssl)(182): <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>XML stanza is too big</text></stream:error>
17:52:05: (Libpurple: connection) Connection error on 0x10d12c710 (reason: 0 description: Richtlinien-Verletzung)
17:52:05: Connection Disconnected: gc=d12c710 (Richtlinien-Verletzung)
17:52:05: <ESPurpleJabberAccount:378b8f0 3> accountConnectionReportDisconnect: Richtlinien-Verletzung
17:52:05: (Libpurple: jabber) Recv (ssl)(16): </stream:stream>
17:52:05: (Libpurple: account) Disconnecting account (0x1037cd660)
17:52:05: (Libpurple: connection) Disconnecting connection 0x10d12c710
17:52:05: (Libpurple: connection) Deactivating keepalive.
17:52:05: (Libpurple: jabber) Sending (ssl) ( </stream:stream>
17:52:05: Disconnected: gc=d12c710
17:52:05: <ESPurpleJabberAccount:378b8f0 3> Telling the core we disconnected
17:52:05: -[AIContactObserverManager endListObjectNotificationsDelaysImmediately]:144: 
17:52:05: <ESPurpleJabberAccount:378b8f0 3> Disconnected ("Richtlinien-Verletzung"): Automatically reconnecting in 5.000000 seconds (0 attempts performed)
17:52:05: (Libpurple: connection) Destroying connection 0x10d12c710
17:52:06: -[AIProxyListObject dealloc]:107: <AIProxyListObject 0x10dc9a6b0 -> (null)>
17:52:10: <ESPurpleJabberAccount:378b8f0 3> Original image of size 260.000000 260.000000
17:52:10: <ESPurpleJabberAccount:378b8f0 3> Scaled image to size {96, 96}
17:52:10: -[CBPurpleAccount setAccountUserImage:withData:]:2717: <ESPurpleJabberAccount:378b8f0 3> Setting icon data of length 86283
17:52:10: <ESPurpleJabberAccount:378b8f0 3> Updating status for key: User Icon

Attachments (1)

detect-hidpi-secondary.diff (2.0 KB) - added by Sonix 7 years ago.
Patch to fix this issue.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by Thijs Alkemade

Resolution: duplicate
Status: newclosed

Closed as duplicate of #16386.

comment:2 Changed 7 years ago by Robert

Cc: Adrian Godoroja added
Resolution: duplicate
Severity: normalregression
Status: closednew

It seems to me this ticket has the best description yet of this issue so I'll forward-duplicate others to it.

comment:3 Changed 7 years ago by Robert

Ticket #16386 has been marked as a duplicate of this ticket.

comment:4 Changed 7 years ago by Sonix

In relation to Ticket #16386 I might add: I am also using a secondary display which is set as the primary display. As noted in Ticket #16063 which links to the diff which should fix the issue I found this particular line of code which might be the problem:

The code checks only the [NSScreen mainScreen] and not other possible screens, so it *might* be that OS X internally still uses HiDPI and Adium fails to detect due to only checking one screen.

A possible fix then would be to iterate over all screens and check if any of them is using HiDPI and then using that scaling Factor.

comment:5 Changed 7 years ago by Robert

Good job! It sounds like you're on the right track. Are you in for a patch? :-)

comment:6 Changed 7 years ago by Sonix

Sure, I will look into it in the next few days :)

comment:7 Changed 7 years ago by Robert


Changed 7 years ago by Sonix

Attachment: detect-hidpi-secondary.diff added

Patch to fix this issue.

comment:8 Changed 7 years ago by Thijs Alkemade

Milestone: Adium 1.5.10
Patch Status: Accepted
Resolution: fixed
Status: newclosed

Committed in a0b7e4250562 (with some minor changes by me to match the style). Thanks for the patch!

comment:9 Changed 7 years ago by Robert

Wow, that's a quick turnaround. Thanks to everyone involved! :-)

comment:10 Changed 7 years ago by Jan-Peter Koopmann

Ticket #16575 has been marked as a duplicate of this ticket.

Note: See TracTickets for help on using tickets.