~vish/ubuntu/maverick/pidgin/bug25979

« back to all changes in this revision

Viewing changes to finch/gntconv.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-09 19:40:26 UTC
  • mfrom: (1.4.1 upstream) (46.1.10 karmic)
  • Revision ID: james.westby@ubuntu.com-20091009194026-wbqqh0bsbz19nx5q
Tags: 1:2.6.2-1ubuntu7
* Don't stick the buddy list window to all desktops as some
  window managers have trouble to properly unstick it (LP: #346840)
  - debian/patches/11_buddy_list_really_show.patch
* Always use default tray icon size on KDE (LP: #209440)
  - debian/patches/62_tray_icon_size_kde.patch
* Use scrollbars in the preferences dialog if the screen height is
  below 700 px instead of 600 px
  - debian/patches/60_1024x600_gtkprefs.c.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <string.h>
27
27
 
28
28
#include "finch.h"
 
29
#include <internal.h>
29
30
 
30
31
#include <cmds.h>
31
32
#include <idle.h>
191
192
        }
192
193
        else
193
194
        {
194
 
                char *escape = g_markup_escape_text((*text == '/' ? text + 1 : text), -1);
195
 
                char *apos = purple_strreplace(escape, "&apos;", "'");
196
 
                g_free(escape);
197
 
                escape = apos;
 
195
                char *escape = purple_markup_escape_text((*text == '/' ? text + 1 : text), -1);
198
196
                switch (purple_conversation_get_type(ggconv->active_conv))
199
197
                {
200
198
                        case PURPLE_CONV_TYPE_IM:
496
494
        buddies = purple_find_buddies(account, name);
497
495
        for (cur = buddies; cur != NULL; cur = cur->next) {
498
496
                PurpleBlistNode *node = cur->data;
499
 
                if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) {
500
 
                        finch_log_show_contact((PurpleContact *)node->parent);
 
497
                if ((node != NULL) &&
 
498
                                (purple_blist_node_get_sibling_prev(node) || purple_blist_node_get_sibling_next(node))) {
 
499
                        finch_log_show_contact((PurpleContact *)purple_blist_node_get_parent(node));
501
500
                        g_slist_free(buddies);
502
501
                        return;
503
502
                }
529
528
        gnt_menuitem_set_submenu(item, GNT_MENU(sub));
530
529
 
531
530
        for (; buds; buds = g_slist_delete_link(buds, buds)) {
532
 
                PurpleBlistNode *node = (PurpleBlistNode *)purple_buddy_get_contact((PurpleBuddy *)buds->data);
 
531
                PurpleBlistNode *node = PURPLE_BLIST_NODE(purple_buddy_get_contact(PURPLE_BUDDY(buds->data)));
533
532
                for (node = purple_blist_node_get_first_child(node); node != NULL;
534
533
                                node = purple_blist_node_get_sibling_next(node)) {
535
534
                        PurpleBuddy *buddy = (PurpleBuddy *)node;
558
557
}
559
558
 
560
559
static void
561
 
invite_select_cb(FinchConv *fc, PurpleRequestFields *fields)
562
 
{
563
 
        PurpleConversation *conv = fc->active_conv;
564
 
        const char *buddy = purple_request_fields_get_string(fields,  "screenname");
565
 
        const char *message = purple_request_fields_get_string(fields,  "message");
566
 
        serv_chat_invite(purple_conversation_get_gc(conv),
567
 
                purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)),
568
 
                message, buddy);
569
 
 
570
 
}
571
 
 
572
 
static void
573
560
invite_cb(GntMenuItem *item, gpointer ggconv)
574
561
{
575
 
        PurpleRequestFields *fields;
576
 
        PurpleRequestFieldGroup *group;
577
 
        PurpleRequestField *field;
578
 
 
579
 
        fields = purple_request_fields_new();
580
 
 
581
 
        group = purple_request_field_group_new(NULL);
582
 
        purple_request_fields_add_group(fields, group);
583
 
 
584
 
        field = purple_request_field_string_new("screenname", _("Name"), NULL, FALSE);
585
 
        purple_request_field_set_type_hint(field, "screenname");
586
 
        purple_request_field_set_required(field, TRUE);
587
 
        purple_request_field_group_add_field(group, field);
588
 
        field = purple_request_field_string_new("message", _("Invite message"), NULL, FALSE);
589
 
        purple_request_field_group_add_field(group, field);
590
 
        purple_request_fields(finch_conv_get_handle(), _("Invite"),
591
 
                                                NULL,
592
 
                                                _("Please enter the name of the user "
593
 
                                                  "you wish to invite,\nalong with an optional invite message."),
594
 
                                                fields,
595
 
                                                _("OK"), G_CALLBACK(invite_select_cb),
596
 
                                                _("Cancel"), NULL,
597
 
                                                NULL, NULL, NULL,
598
 
                                                ggconv);
 
562
        FinchConv *fc = ggconv;
 
563
        PurpleConversation *conv = fc->active_conv;
 
564
        purple_conv_chat_invite_user(PURPLE_CONV_CHAT(conv), NULL, NULL, TRUE);
599
565
}
600
566
 
601
567
static void
916
882
        gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), "\n", GNT_TEXT_FLAG_NORMAL);
917
883
 
918
884
        /* Unnecessary to print the timestamp for delayed message */
919
 
        if (purple_prefs_get_bool("/finch/conversations/timestamps"))
 
885
        if (purple_prefs_get_bool("/finch/conversations/timestamps")) {
 
886
                if (!mtime)
 
887
                        time(&mtime);
920
888
                gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
921
889
                                        purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), gnt_color_pair(color_timestamp));
 
890
        }
922
891
 
923
892
        gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), " ", GNT_TEXT_FLAG_NORMAL);
924
893