]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-message.c
individual-menu: remove link-contacts-activated signal
[empathy.git] / libempathy / empathy-message.c
index 995f49ab7e299dda1e24e9e3f67f3dd2a0b6de6f..6111bcd8c25ace3f783f840325353b111c62a964 100644 (file)
@@ -633,75 +633,6 @@ empathy_message_is_backlog (EmpathyMessage *message)
        return priv->is_backlog;
 }
 
-#define IS_SEPARATOR(ch) (ch == ' ' || ch == ',' || ch == '.' || ch == ':')
-gboolean
-empathy_message_should_highlight (EmpathyMessage *message)
-{
-       EmpathyContact *contact;
-       const gchar   *msg, *to;
-       gchar         *cf_msg, *cf_to;
-       gchar         *ch;
-       gboolean       ret_val;
-       TpChannelTextMessageFlags flags;
-
-       g_return_val_if_fail (EMPATHY_IS_MESSAGE (message), FALSE);
-
-       ret_val = FALSE;
-
-       msg = empathy_message_get_body (message);
-       if (!msg) {
-               return FALSE;
-       }
-
-       contact = empathy_message_get_receiver (message);
-       if (!contact || !empathy_contact_is_user (contact)) {
-               return FALSE;
-       }
-
-       to = empathy_contact_get_alias (contact);
-       if (!to) {
-               return FALSE;
-       }
-
-       flags = empathy_message_get_flags (message);
-       if (flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK) {
-               /* FIXME: Ideally we shouldn't highlight scrollback messages only if they
-                * have already been received by the user before (and so are in the logs) */
-               return FALSE;
-       }
-
-       cf_msg = g_utf8_casefold (msg, -1);
-       cf_to = g_utf8_casefold (to, -1);
-
-       ch = strstr (cf_msg, cf_to);
-       if (ch == NULL) {
-               goto finished;
-       }
-       if (ch != cf_msg) {
-               /* Not first in the message */
-               if (!IS_SEPARATOR (*(ch - 1))) {
-                       goto finished;
-               }
-       }
-
-       ch = ch + strlen (cf_to);
-       if (ch >= cf_msg + strlen (cf_msg)) {
-               ret_val = TRUE;
-               goto finished;
-       }
-
-       if (IS_SEPARATOR (*ch)) {
-               ret_val = TRUE;
-               goto finished;
-       }
-
-finished:
-       g_free (cf_msg);
-       g_free (cf_to);
-
-       return ret_val;
-}
-
 TpChannelTextMessageType
 empathy_message_type_from_str (const gchar *type_str)
 {