~vish/ubuntu/maverick/pidgin/bug25979

« back to all changes in this revision

Viewing changes to libpurple/protocols/jabber/google.c

  • Committer: Bazaar Package Importer
  • Author(s): Nick Andrik
  • Date: 2009-05-27 02:23:16 UTC
  • mfrom: (1.1.18 upstream) (2.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090527022316-xdj3a6svtqk7aojv
Tags: 1:2.5.6-1ubuntu1
* Merge from debian, remaining changes (LP: #380806 ):
  - Update debian/prefs.xml to set the notify plugin prefs
    /plugins/gtk/X11/notify/*, set /pidgin/plugins/loaded to load
    the notify plugin and enable the standard logging options by default
  - debian/patches:
    + 02_lpi.patch for LP integration
    + 04_let_crasher_for_apport.patch to stop catching the SIGSEGV signal
      and let apport handle it
    + 05_default_to_irc_ubuntu_com.patch to set the default IRC
      server to irc.ubuntu.com
    + 10_docklet_default_off.patch for default behavior to have no
      notification area icon.  This fixes (LP: #340366)
    + 11_buddy_list_really_show.patch to make it so that the buddy
      list tries harder to appear.  This fixes some issues with it
      not appearing.  (LP: #341142)
    + 12_rate_limit_aim_blist_warning.patch to rate limit popups when
      AIM buddy list is unavailable (LP: #345774)
    + 13_sounds_and_timers.patch which adjusts the time out for sounds
      to be 15 seconds, which helps get fewer spurious login
      notifications on slow connections.  Also, switches a few long
      term timers to _add_seconds to get a little bit of power savings.
      (LP: #345494)
    + 60_1024x600_gtk*.c.patch: Add scrolled bars into account dialog,
      pounce windows and preference window when screen height is less than 600.
    + 70_autoconf.patch
  - debian/control:
    + Drop the libpurple0 dependency on libpurple-bin
    + Add Build-Deps on liblaunchpad-integration-dev, intltool,
    network-manager-dev
    + Make finch conflict & replace old versions of gaim (closes: #440351)
    + Add epoch in dependencies
  - debian/libpurple0.symbols:
    + Add libgnt to symbols
    + Add epoch to versions
  - debian/pidgin-dbg.preinst, debian/pidgin-dev.preinst,
    debian/pidgin.preinst: Add epoch
  - debian/rules:
    + remove --disable-nm as nm has been fixed in Ubuntu
    + Add X-Ubuntu-Gettext-Domain to the desktop file and update the
      translation templates in common-install-impl::

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        char *subject;
40
40
        const char *in_str;
41
41
        char *to_name;
42
 
        char *default_tos[1];
43
42
 
44
43
        int i, count = 1, returned_count;
45
44
 
59
58
 
60
59
        /* If Gmail doesn't tell us who the mail is to, let's use our JID */
61
60
        to = xmlnode_get_attrib(packet, "to");
62
 
        default_tos[0] = jabber_get_bare_jid(to);
63
61
 
64
62
        message = xmlnode_get_child(child, "mail-thread-info");
65
63
 
66
64
        if (count == 0 || !message) {
67
 
                if (count > 0)
68
 
                        purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
69
 
                g_free(default_tos[0]);
 
65
                if (count > 0) {
 
66
                        char *bare_jid = jabber_get_bare_jid(to);
 
67
                        const char *default_tos[2] = { bare_jid };
 
68
 
 
69
                        purple_notify_emails(js->gc, count, FALSE, NULL, NULL, default_tos, NULL, NULL, NULL);
 
70
                        g_free(bare_jid);
 
71
                } else {
 
72
                        purple_notify_emails(js->gc, count, FALSE, NULL, NULL, NULL, NULL, NULL, NULL);
 
73
                }
 
74
 
70
75
                return;
71
76
        }
72
77
 
74
79
         * accordingly */
75
80
        for (returned_count = 0; message; returned_count++, message=xmlnode_get_next_twin(message));
76
81
 
77
 
        froms    = g_new0(const char* , returned_count);
78
 
        tos      = g_new0(const char* , returned_count);
79
 
        subjects = g_new0(char* , returned_count);
80
 
        urls     = g_new0(const char* , returned_count);
 
82
        froms    = g_new0(const char* , returned_count + 1);
 
83
        tos      = g_new0(const char* , returned_count + 1);
 
84
        subjects = g_new0(char* , returned_count + 1);
 
85
        urls     = g_new0(const char* , returned_count + 1);
81
86
 
82
87
        to = xmlnode_get_attrib(packet, "to");
83
88
        to_name = jabber_get_bare_jid(to);
123
128
        if (i>0)
124
129
                purple_notify_emails(js->gc, count, count == i, (const char**) subjects, froms, tos,
125
130
                                urls, NULL, NULL);
126
 
        else
127
 
                purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
128
 
 
129
131
 
130
132
        g_free(to_name);
131
133
        g_free(tos);
132
 
        g_free(default_tos[0]);
133
134
        g_free(froms);
134
 
        for (; i > 0; i--)
135
 
                g_free(subjects[i - 1]);
 
135
        for (i = 0; i < returned_count; i++)
 
136
                g_free(subjects[i]);
136
137
        g_free(subjects);
137
138
        g_free(urls);
138
139