return priv->remote_contact;
}
+guint
+empathy_chat_get_members_count (EmpathyChat *chat)
+{
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
+ g_return_val_if_fail (EMPATHY_IS_CHAT (chat), 0);
+
+ if (priv->tp_chat) {
+ return empathy_tp_chat_get_members_count (priv->tp_chat);
+ }
+
+ return 0;
+}
+
void
empathy_chat_clear (EmpathyChat *chat)
{
const gchar * empathy_chat_get_name (EmpathyChat *chat);
const gchar * empathy_chat_get_subject (EmpathyChat *chat);
EmpathyContact * empathy_chat_get_remote_contact (EmpathyChat *chat);
+guint empathy_chat_get_members_count (EmpathyChat *chat);
void empathy_chat_clear (EmpathyChat *chat);
void empathy_chat_scroll_down (EmpathyChat *chat);
void empathy_chat_cut (EmpathyChat *chat);
gboolean had_properties_list;
GPtrArray *properties;
gboolean ready;
- guint nb_members;
+ guint members_count;
};
typedef struct {
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
- priv->nb_members++;
- if (priv->nb_members > 2 && priv->remote_contact) {
+ priv->members_count++;
+ if (priv->members_count > 2 && priv->remote_contact) {
/* We now have more than 2 members, this is not a p2p chat
* anymore. Remove the remote-contact as it makes no sense, the
* EmpathyContactList interface must be used now. */
priv->remote_contact = NULL;
g_object_notify (G_OBJECT (chat), "remote-contact");
}
- if (priv->nb_members <= 2 && !priv->remote_contact &&
+ if (priv->members_count <= 2 && !priv->remote_contact &&
!empathy_contact_is_user (contact)) {
/* This is a p2p chat, if it's not ourself that means this is
* the remote contact with who we are chatting. This is to
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
- priv->nb_members--;
- if (priv->nb_members <= 2 && !priv->remote_contact) {
+ priv->members_count--;
+ if (priv->members_count <= 2 && !priv->remote_contact) {
GList *members, *l;
/* We are not a MUC anymore, get the remote contact back */
G_CALLBACK (tp_chat_local_pending_cb),
chat);
empathy_run_until_ready (priv->group);
+ } else {
+ priv->members_count = 2;
}
if (tp_proxy_has_interface_by_id (priv->channel,
return priv->ready;
}
+guint
+empathy_tp_chat_get_members_count (EmpathyTpChat *chat)
+{
+ EmpathyTpChatPriv *priv = GET_PRIV (chat);
+
+ g_return_val_if_fail (EMPATHY_IS_TP_CHAT (chat), 0);
+
+ return priv->members_count;
+}
+
McAccount *
empathy_tp_chat_get_account (EmpathyTpChat *chat)
{
EmpathyContact*empathy_tp_chat_get_remote_contact (EmpathyTpChat *chat);
McAccount * empathy_tp_chat_get_account (EmpathyTpChat *chat);
gboolean empathy_tp_chat_is_ready (EmpathyTpChat *chat);
+guint empathy_tp_chat_get_members_count (EmpathyTpChat *chat);
void empathy_tp_chat_send (EmpathyTpChat *chat,
EmpathyMessage *message);
void empathy_tp_chat_set_state (EmpathyTpChat *chat,
priv = GET_PRIV (window);
has_focus = empathy_chat_window_has_focus (window);
-
+
if (has_focus && priv->current_chat == chat) {
return;
}
- needs_urgency = empathy_message_should_highlight (message);
+ if (empathy_chat_get_members_count (chat) > 2) {
+ needs_urgency = empathy_message_should_highlight (message);
+ } else {
+ needs_urgency = TRUE;
+ }
if (needs_urgency && !has_focus) {
chat_window_set_urgency_hint (window, TRUE);