diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-02-09 05:09:59 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-02-09 05:09:59 +0800 |
commit | 675deab25d7076195e356c84e55de5207b8c3c6f (patch) | |
tree | 896c57db3e3277c69c687fdef823e82fefd55ab9 /libempathy | |
parent | c8e6bc3f8314a881264fa9f2b160eee39cf4d8fe (diff) | |
download | gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.gz gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.bz2 gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.lz gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.xz gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.zst gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.zip |
Change new message dialog to new conversation and make possible to do voip call.
svn path=/trunk/; revision=608
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-utils.c | 70 | ||||
-rw-r--r-- | libempathy/empathy-utils.h | 4 |
2 files changed, 25 insertions, 49 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index c810f9cca..796d23ddf 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -397,61 +397,36 @@ empathy_inspect_handle (McAccount *account, } void -empathy_call_contact (EmpathyContact *contact) +empathy_call_with_contact (EmpathyContact *contact) { #ifdef HAVE_VOIP MissionControl *mc; - McAccount *account; - TpConn *tp_conn; - gchar *object_path; - const gchar *bus_name; - TpChan *new_chan; - EmpathyTpGroup *group; - GError *error = NULL; - - g_return_if_fail (EMPATHY_IS_CONTACT (contact)); - - /* StreamedMedia channels must have handle=0 and handle_type=none. - * To call a contact we have to add him in the group interface of the - * channel. MissionControl will detect the channel creation and - * dispatch it to the VoIP chandler automatically. */ mc = empathy_mission_control_new (); - account = empathy_contact_get_account (contact); - tp_conn = mission_control_get_connection (mc, account, NULL); - /* FIXME: Should be async */ - if (!tp_conn_request_channel (DBUS_G_PROXY (tp_conn), - TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, - TP_HANDLE_TYPE_NONE, - 0, - FALSE, - &object_path, - &error)) { - empathy_debug (DEBUG_DOMAIN, - "Couldn't request channel: %s", - error ? error->message : "No error given"); - g_clear_error (&error); - g_object_unref (mc); - g_object_unref (tp_conn); - return; - } - - bus_name = dbus_g_proxy_get_bus_name (DBUS_G_PROXY (tp_conn)); - new_chan = tp_chan_new (tp_get_bus (), - bus_name, - object_path, - TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, - TP_HANDLE_TYPE_NONE, - 0); + mission_control_request_channel (mc, + empathy_contact_get_account (contact), + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, + empathy_contact_get_handle (contact), + TP_HANDLE_TYPE_CONTACT, + NULL, NULL); + g_object_unref (mc); +#endif +} - group = empathy_tp_group_new (account, new_chan); - empathy_tp_group_add_member (group, contact, ""); +void +empathy_call_with_contact_id (McAccount *account, const gchar *contact_id) +{ +#ifdef HAVE_VOIP + MissionControl *mc; - g_object_unref (group); + mc = empathy_mission_control_new (); + mission_control_request_channel_with_string_handle (mc, + account, + TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, + contact_id, + TP_HANDLE_TYPE_CONTACT, + NULL, NULL); g_object_unref (mc); - g_object_unref (tp_conn); - g_object_unref (new_chan); - g_free (object_path); #endif } @@ -485,7 +460,6 @@ empathy_chat_with_contact_id (McAccount *account, const gchar *contact_id) g_object_unref (mc); } - const gchar * empathy_presence_get_default_message (McPresence presence) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 875128c1e..cafc3db10 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -88,7 +88,9 @@ gchar * empathy_inspect_handle (McAccount *account, guint handle_type); gchar * empathy_inspect_channel (McAccount *account, TpChan *tp_chan); -void empathy_call_contact (EmpathyContact *contact); +void empathy_call_with_contact (EmpathyContact *contact); +void empathy_call_with_contact_id (McAccount *account, + const gchar *contact_id); void empathy_chat_with_contact (EmpathyContact *contact); void empathy_chat_with_contact_id (McAccount *account, const gchar *contact_id); |