aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact.c21
-rw-r--r--libempathy/empathy-contact.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 680094a54..620c479e2 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1098,6 +1098,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;
@@ -1189,6 +1201,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;
@@ -1729,6 +1744,12 @@ tp_caps_to_capabilities (TpCapabilities *caps)
TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, NULL))
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;
diff --git a/libempathy/empathy-contact.h b/libempathy/empathy-contact.h
index f9217c108..16b50e500 100644
--- a/libempathy/empathy-contact.h
+++ b/libempathy/empathy-contact.h
@@ -67,6 +67,7 @@ typedef enum {
EMPATHY_CAPABILITIES_VIDEO = 1 << 1,
EMPATHY_CAPABILITIES_FT = 1 << 2,
EMPATHY_CAPABILITIES_RFB_STREAM_TUBE = 1 << 3,
+ EMPATHY_CAPABILITIES_SMS = 1 << 4,
EMPATHY_CAPABILITIES_UNKNOWN = 1 << 7
} EmpathyCapabilities;
@@ -94,6 +95,7 @@ void empathy_contact_set_is_user (EmpathyContact *contact,
gboolean is_user);
gboolean empathy_contact_is_online (EmpathyContact *contact);
const gchar * empathy_contact_get_status (EmpathyContact *contact);
+gboolean empathy_contact_can_sms (EmpathyContact *contact);
gboolean empathy_contact_can_voip (EmpathyContact *contact);
gboolean empathy_contact_can_voip_audio (EmpathyContact *contact);
gboolean empathy_contact_can_voip_video (EmpathyContact *contact);
@@ -102,6 +104,7 @@ gboolean empathy_contact_can_use_rfb_stream_tube (EmpathyContact *contact);
typedef enum {
EMPATHY_ACTION_CHAT,
+ EMPATHY_ACTION_SMS,
EMPATHY_ACTION_AUDIO_CALL,
EMPATHY_ACTION_VIDEO_CALL,
EMPATHY_ACTION_VIEW_LOGS,