aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-06 14:34:43 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-08 08:55:12 +0800
commit065e5efff3e181b8de28d3b0e04e7378d53f2e44 (patch)
tree311dd7d3f0805dbe94ad06c19327c91e0ebfc39b /libempathy/empathy-contact.c
parente84d41efe4b2febb9f3276e54f603550c929a69d (diff)
downloadgsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar.gz
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar.bz2
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar.lz
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar.xz
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.tar.zst
gsoc2013-empathy-065e5efff3e181b8de28d3b0e04e7378d53f2e44.zip
Add SMS entry to empathy-individual-menu
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 3706658fa..a9503e14a 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1075,6 +1075,18 @@ empathy_contact_get_status (EmpathyContact *contact)
}
gboolean
+empathy_contact_can_sms (EmpathyContact *contact)
+{
+ EmpathyContactPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), FALSE);
+
+ priv = GET_PRIV (contact);
+
+ return priv->capabilities & EMPATHY_CAPABILITIES_SMS;
+}
+
+gboolean
empathy_contact_can_voip (EmpathyContact *contact)
{
EmpathyContactPriv *priv;
@@ -1166,6 +1178,9 @@ empathy_contact_can_do_action (EmpathyContact *self,
case EMPATHY_ACTION_CHAT:
sensitivity = TRUE;
break;
+ case EMPATHY_ACTION_SMS:
+ sensitivity = empathy_contact_can_sms (self);
+ break;
case EMPATHY_ACTION_AUDIO_CALL:
sensitivity = empathy_contact_can_voip_audio (self);
break;
@@ -1697,6 +1712,12 @@ tp_caps_to_capabilities (TpCapabilities *caps)
capabilities |= EMPATHY_CAPABILITIES_VIDEO;
}
}
+ else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT))
+ {
+ if (tp_asv_get_boolean (fixed_prop,
+ TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL))
+ capabilities |= EMPATHY_CAPABILITIES_SMS;
+ }
}
return capabilities;