~bcurtiswx/ubuntu/precise/empathy/3.4.2.1-0ubuntu1

« back to all changes in this revision

Viewing changes to libempathy-gtk/empathy-chat.c

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2012-03-05 15:14:36 UTC
  • mfrom: (1.1.87)
  • Revision ID: package-import@ubuntu.com-20120305151436-utnrdabb2ppp3kw1
Tags: 3.3.90.2-0ubuntu1
* New upstream release
* debian/control
  - added yelp-tools and libfarstream-0.1-dev build depends
  - bump build depends on libtelepathy-farstream-dev, and 
    libtelepathy-glib-dev
  - bumpded depends for telepathy-mission-control-5
  - removed telepathy-butterfly recommends, mission-control-5 ensures 
    telepathy-haze handles MSN now.
* debian/rules
  - enable empathy-av 

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        /* A regex matching our own current nickname in the room, or %NULL if
161
161
         * !empathy_chat_is_room (). */
162
162
        GRegex            *highlight_regex;
 
163
 
 
164
        /* TRUE if empathy_chat_is_room () and there are unread highlighted messages.
 
165
         * Cleared by empathy_chat_messages_read (). */
 
166
        gboolean           highlighted;
163
167
};
164
168
 
165
169
typedef struct {
373
377
chat_composing_stop_timeout_cb (EmpathyChat *chat)
374
378
{
375
379
        EmpathyChatPriv *priv;
 
380
        gboolean send_chat_states;
376
381
 
377
382
        priv = GET_PRIV (chat);
378
383
 
379
384
        priv->composing_stop_timeout_id = 0;
380
 
        set_chat_state (chat, TP_CHANNEL_CHAT_STATE_PAUSED);
 
385
        send_chat_states = g_settings_get_boolean (priv->gsettings_chat,
 
386
                                         EMPATHY_PREFS_CHAT_SEND_CHAT_STATES);
 
387
        if (!send_chat_states) {
 
388
                set_chat_state (chat, TP_CHANNEL_CHAT_STATE_ACTIVE);
 
389
        } else {
 
390
                set_chat_state (chat, TP_CHANNEL_CHAT_STATE_PAUSED);
 
391
        }
381
392
 
382
393
        return FALSE;
383
394
}
386
397
chat_composing_start (EmpathyChat *chat)
387
398
{
388
399
        EmpathyChatPriv *priv;
 
400
        gboolean send_chat_states;
389
401
 
390
402
        priv = GET_PRIV (chat);
391
403
 
 
404
        send_chat_states = g_settings_get_boolean (priv->gsettings_chat,
 
405
                                          EMPATHY_PREFS_CHAT_SEND_CHAT_STATES);
 
406
        if (!send_chat_states) {
 
407
                return;
 
408
        }
 
409
 
392
410
        if (priv->composing_stop_timeout_id) {
393
411
                /* Just restart the timeout */
394
412
                chat_composing_remove_timeout (chat);
1484
1502
                empathy_chat_view_edit_message (chat->view, message);
1485
1503
        } else {
1486
1504
                gboolean should_highlight = chat_should_highlight (chat, message);
 
1505
 
 
1506
                if (should_highlight) {
 
1507
                        priv->highlighted = TRUE;
 
1508
                }
 
1509
 
1487
1510
                DEBUG ("Appending new message '%s' from %s (%d)",
1488
1511
                        empathy_message_get_token (message),
1489
1512
                        empathy_contact_get_alias (sender),
4146
4169
        if (contact == NULL)
4147
4170
                return NULL;
4148
4171
 
4149
 
        individual = empathy_create_individual_from_tp_contact (contact);
 
4172
        individual = empathy_ensure_individual_from_tp_contact (contact);
 
4173
 
4150
4174
        if (individual == NULL)
4151
4175
                return NULL;
4152
4176
 
4308
4332
        return (priv->handle_type == TP_HANDLE_TYPE_ROOM);
4309
4333
}
4310
4334
 
 
4335
gboolean
 
4336
empathy_chat_is_highlighted (EmpathyChat *chat)
 
4337
{
 
4338
        EmpathyChatPriv *priv = GET_PRIV (chat);
 
4339
 
 
4340
        g_return_val_if_fail (EMPATHY_IS_CHAT (chat), FALSE);
 
4341
 
 
4342
        return priv->highlighted;
 
4343
}
 
4344
 
4311
4345
guint
4312
4346
empathy_chat_get_nb_unread_messages (EmpathyChat *self)
4313
4347
{
4336
4370
                        TP_TEXT_CHANNEL (priv->tp_chat), NULL, NULL);
4337
4371
        }
4338
4372
 
 
4373
        priv->highlighted = FALSE;
 
4374
 
4339
4375
        if (priv->unread_messages_when_offline > 0) {
4340
4376
                /* We can't ack those as the connection has gone away so just consider
4341
4377
                * them as read. */