aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-01-02 05:29:21 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-01-02 05:29:21 +0800
commit6fd6f3b1081a5b72054ef135346da0d5eb979590 (patch)
tree99644087c07e90132cd3c07df505a64e2c3edc24 /libempathy/empathy-utils.c
parentf4d9313a82b4ce88b87bba1427fdbece4f1d00ad (diff)
downloadgsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar.gz
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar.bz2
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar.lz
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar.xz
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.tar.zst
gsoc2013-empathy-6fd6f3b1081a5b72054ef135346da0d5eb979590.zip
Add convinience functions empathy_chat_with_contact() and empathy_chat_with_contact_id() to start a chat with a contact. Make use of it when appropriate.
svn path=/trunk/; revision=527
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index f322f0288..0e2c4b588 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -451,3 +451,33 @@ empathy_call_contact (EmpathyContact *contact)
#endif
}
+void
+empathy_chat_with_contact (EmpathyContact *contact)
+{
+ MissionControl *mc;
+
+ mc = empathy_mission_control_new ();
+ mission_control_request_channel (mc,
+ empathy_contact_get_account (contact),
+ TP_IFACE_CHANNEL_TYPE_TEXT,
+ empathy_contact_get_handle (contact),
+ TP_HANDLE_TYPE_CONTACT,
+ NULL, NULL);
+ g_object_unref (mc);
+}
+
+void
+empathy_chat_with_contact_id (McAccount *account, const gchar *contact_id)
+{
+ MissionControl *mc;
+
+ mc = empathy_mission_control_new ();
+ mission_control_request_channel_with_string_handle (mc,
+ account,
+ TP_IFACE_CHANNEL_TYPE_TEXT,
+ contact_id,
+ TP_HANDLE_TYPE_CONTACT,
+ NULL, NULL);
+ g_object_unref (mc);
+}
+