diff options
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r-- | libempathy/empathy-contact.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 680094a54..f3e200e27 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -653,8 +653,8 @@ empathy_contact_from_tpl_contact (TpAccount *account, is_user = (TPL_ENTITY_SELF == tpl_entity_get_entity_type (tpl_entity)); retval = g_object_new (EMPATHY_TYPE_CONTACT, - "id", tpl_entity_get_alias (tpl_entity), - "alias", tpl_entity_get_identifier (tpl_entity), + "id", tpl_entity_get_identifier (tpl_entity), + "alias", tpl_entity_get_alias (tpl_entity), "account", account, "is-user", is_user, NULL); @@ -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; |