comparison libpurple/conversation.c @ 25895:a81f75025e14

propagate from branch 'im.pidgin.pidgin.2.5.5.veracode' (head 1744a346c5951c97b5d6ec102b49606f3dd918cc) to branch 'im.pidgin.pidgin.2.5.6' (head 9fe90237b75569f21f8de666d690a38109709df0)
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 14 May 2009 21:17:11 +0000
parents 51ff18d00dea
children 01f1929d0936
comparison
equal deleted inserted replaced
25846:c7ec8f3b39d3 25895:a81f75025e14
31 #include "prpl.h" 31 #include "prpl.h"
32 #include "request.h" 32 #include "request.h"
33 #include "signals.h" 33 #include "signals.h"
34 #include "util.h" 34 #include "util.h"
35 35
36 #define SEND_TYPED_TIMEOUT 5000 36 #define SEND_TYPED_TIMEOUT_SECONDS 5
37 37
38 static GList *conversations = NULL; 38 static GList *conversations = NULL;
39 static GList *ims = NULL; 39 static GList *ims = NULL;
40 static GList *chats = NULL; 40 static GList *chats = NULL;
41 static PurpleConversationUiOps *default_ops = NULL; 41 static PurpleConversationUiOps *default_ops = NULL;
1120 void 1120 void
1121 purple_conv_im_start_send_typed_timeout(PurpleConvIm *im) 1121 purple_conv_im_start_send_typed_timeout(PurpleConvIm *im)
1122 { 1122 {
1123 g_return_if_fail(im != NULL); 1123 g_return_if_fail(im != NULL);
1124 1124
1125 im->send_typed_timeout = purple_timeout_add(SEND_TYPED_TIMEOUT, send_typed_cb, 1125 im->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS,
1126 purple_conv_im_get_conversation(im)); 1126 send_typed_cb,
1127 purple_conv_im_get_conversation(im));
1127 } 1128 }
1128 1129
1129 void 1130 void
1130 purple_conv_im_stop_send_typed_timeout(PurpleConvIm *im) 1131 purple_conv_im_stop_send_typed_timeout(PurpleConvIm *im)
1131 { 1132 {
1474 /* Don't display this if the person who wrote it is ignored. */ 1475 /* Don't display this if the person who wrote it is ignored. */
1475 if (purple_conv_chat_is_user_ignored(chat, who)) 1476 if (purple_conv_chat_is_user_ignored(chat, who))
1476 return; 1477 return;
1477 1478
1478 if (!(flags & PURPLE_MESSAGE_WHISPER)) { 1479 if (!(flags & PURPLE_MESSAGE_WHISPER)) {
1479 char *str; 1480 const char *str;
1480 1481
1481 str = g_strdup(purple_normalize(account, who)); 1482 str = purple_normalize(account, who);
1482 1483
1483 if (!strcmp(str, purple_normalize(account, chat->nick))) { 1484 if (!strcmp(str, chat->nick)) {
1484 flags |= PURPLE_MESSAGE_SEND; 1485 flags |= PURPLE_MESSAGE_SEND;
1485 } else { 1486 } else {
1486 flags |= PURPLE_MESSAGE_RECV; 1487 flags |= PURPLE_MESSAGE_RECV;
1487 1488
1488 if (purple_utf8_has_word(message, chat->nick)) 1489 if (purple_utf8_has_word(message, chat->nick))
1489 flags |= PURPLE_MESSAGE_NICK; 1490 flags |= PURPLE_MESSAGE_NICK;
1490 } 1491 }
1491
1492 g_free(str);
1493 } 1492 }
1494 1493
1495 /* Pass this on to either the ops structure or the default write func. */ 1494 /* Pass this on to either the ops structure or the default write func. */
1496 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL) 1495 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL)
1497 conv->ui_ops->write_chat(conv, who, message, flags, mtime); 1496 conv->ui_ops->write_chat(conv, who, message, flags, mtime);