[Bug 48780] New: add API to request channels without speaking fluent D-Bus

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 16 20:32:37 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=48780

             Bug #: 48780
           Summary: add API to request channels without speaking fluent
                    D-Bus
    Classification: Unclassified
           Product: Telepathy
           Version: git master
          Platform: Other
        OS/Version: All
            Status: ASSIGNED
          Keywords: patch
          Severity: enhancement
          Priority: medium
         Component: tp-glib
        AssignedTo: simon.mcvittie at collabora.co.uk
        ReportedBy: simon.mcvittie at collabora.co.uk
         QAContact: telepathy-bugs at lists.freedesktop.org


At the moment, requesting a channel requires that you construct a GHashTable
and populate it with D-Bus properties.

It should be possible to do simple channel requests without doing all that,
using TpAccountChannelRequest as the high-level API.

Here's what I propose (using PyGI as pseudocode):

    acr = Tp.AccountChannelRequest.new_file_transfer(account,
        # in other channel types' helper functions, the mandatory properties
        # go here (e.g. Text doesn't have any)
        "warez.rar",             # filename
        "application/x-rar",     # MIME type
        1024 * 1024,             # file size
        Tp.USER_ACTION_TIME_CURRENT_TIME)

    # properties which can be done several ways (target) are a method
    acr.set_target_contact(alice)
    # equivalent: acr.set_target_id(Tp.HandleType.CONTACT, "alice at example.com")

    # non-mandatory properties work like this too
    acr.set_file_transfer_uri("file:///tmp/warez.rar")

    # just like before
    acr.create_and_handle_channel_async(...)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list