Bug 18202 - [dbus-glib limitation] GetAvatarRequirements returns u instead of q
Summary: [dbus-glib limitation] GetAvatarRequirements returns u instead of q
Status: NEW
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-24 04:32 UTC by Stefan Eilers
Modified: 2009-02-09 07:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Eilers 2008-10-24 04:32:07 UTC
Checked Gabble version 0.7.12

The spec defines the following:
    <method name="GetAvatarRequirements"
      tp:name-for-bindings="Get_Avatar_Requirements">
      <arg direction="out" type="as">
        <tp:docstring>
          An array of supported MIME types (eg image/jpeg)
        </tp:docstring>
      </arg>
      <arg direction="out" type="q">
        <tp:docstring>
          The minimum image width in pixels
        </tp:docstring>
      </arg>
      <arg direction="out" type="q">
        <tp:docstring>
          The minimum image height in pixels
        </tp:docstring>
      </arg>
      <arg direction="out" type="q">
        <tp:docstring>
          The maximum image width in pixels, or 0 if there is no limit
        </tp:docstring>
      </arg>
      <arg direction="out" type="q">
        <tp:docstring>
          The maximum image height in pixels, or 0 if there is no limit
        </tp:docstring>
      </arg>
      <arg direction="out" type="u">
        <tp:docstring>
          The maximum image size in bytes, or 0 if there is no limit
        </tp:docstring>
      </arg>

But I receive on the DBUS:
method call sender=:1.261 -> dest=org.freedesktop.Telepathy.Connection.gabble.jabber.basyskom_40localhost_2fTelepathy path=/org/freedesktop/Telepathy/Connection/gabble/jabber/basyskom_40localhost_2fTelepathy; interface=org.freedesktop.Telepathy.Connection.Interface.Avatars; member=GetAvatarRequirements
method return sender=:1.262 -> dest=:1.261 reply_serial=39
   array [
      string "image/png"
      string "image/jpeg"
      string "image/gif"
   ]
   uint32 32
   uint32 32
   uint32 96
   uint32 96
   uint32 8192
Comment 1 Simon McVittie 2008-10-24 04:48:46 UTC
Damn. We might not even be able to solve this... it's almost certainly dbus-glib's fault.

(dbus-glib doesn't differentiate between 16- and 32-bit integers - it maps them both to G_TYPE_[U]INT - so it doesn't notice the difference. Python is also very permissive about types, so we've never encountered this problem in GLib and Python bindings...)

As a temporary workaround, don't bother calling GetAvatarRequirements, and just assume something reasonable (64x64 JPEGs or PNGs should work on most protocols for instance).

We could work around this service-side by adding an AvatarRequirements property that avoids the problematic 16-bit types.


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.