~ubuntu-branches/ubuntu/intrepid/pidgin/intrepid-security

« back to all changes in this revision

Viewing changes to libpurple/protocols/oscar/oscar.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2008-04-04 02:18:00 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080404021800-qaa00wom38gd7xus
Tags: 1:2.4.1-1ubuntu1
* Sync with Debian, remaining Ubuntu changes; (LP: #211769)
  - debian/control:
    + Set Maintainer to Ubuntu Core Developers.
    + Add build-deps on liblaunchpad-integration-dev, intltool,
      libnm-glib-dev (for --enable-nm)
    + Drop build-deps on libsilc-1.1-2-dev | libsilc-dev (>= 1.1.1) as
      this library is in universe.
    + Drop the libpurple0 recommends on libpurple-bin.
    + Add a gaim transitionnal package for upgrades.
    + Moved finch's libx11-6 dependency to Suggests
  - Ship compatibility symlinks via debian/gaim.links
  - debian/rules:
    + Pass --enable-nm to configure to enable NetworkManager support
    + Pass --disable-silc to configure to disable silc support even if
      it's installed in the build environment.
    + Add X-Ubuntu-Gettext-Domain to the desktop file and update the
      translation templates in common-install-impl::.
    + Added necessary arguments to dh_shlibdeps for finch
  - Update debian/prefs.xml to set the notify plugin prefs
    /plugins/gtk/X11/notify/* and set /pidgin/plugins/loaded to load
    the notify plugin
  - debian/patches:
    + 02_lpi for LP integration
    + 04_let_crasher_for_apport to stop catching the SIGSEGV signal
      and let apport handle it
    + 05_default_to_irc_ubuntu_com to set the default IRC
      server to irc.ubuntu.com.
    + 70_autoconf patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
void oscar_set_info(PurpleConnection *gc, const char *info);
203
203
static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status);
204
204
static void oscar_set_extendedstatus(PurpleConnection *gc);
205
 
static void oscar_format_screenname(PurpleConnection *gc, const char *nick); 
 
205
static void oscar_format_screenname(PurpleConnection *gc, const char *nick);
206
206
static gboolean purple_ssi_rerequestdata(gpointer data);
207
207
 
208
208
static void oscar_free_name_data(struct name_data *data) {
245
245
        }
246
246
 
247
247
        /*
248
 
         * Must we send this message as UNICODE (in the UCS-2BE encoding)?
 
248
         * Must we send this message as UNICODE (in the UTF-16BE encoding)?
249
249
         */
250
250
        while (utf8[i])
251
251
        {
314
314
        } else if (!g_ascii_strcasecmp(encoding, "unicode-2-0")) {
315
315
                /* Some official ICQ clients are apparently total crack,
316
316
                 * and have been known to save a UTF-8 string converted
317
 
                 * from the locale character set to UCS-2 (not from UTF-8
318
 
                 * to UCS-2!) in the away message.  This hack should find
 
317
                 * from the locale character set to UTF-16 (not from UTF-8
 
318
                 * to UTF-16!) in the away message.  This hack should find
319
319
                 * and do something (un)reasonable with that, and not
320
320
                 * mess up too much else. */
321
321
                const gchar *charset = purple_account_get_string(account, "encoding", NULL);
322
322
                if (charset) {
323
323
                        gsize len;
324
 
                        utf8 = g_convert(text, textlen, charset, "UCS-2BE", &len, NULL, NULL);
 
324
                        utf8 = g_convert(text, textlen, charset, "UTF-16BE", &len, NULL, NULL);
325
325
                        if (!utf8 || len != textlen || !g_utf8_validate(utf8, -1, NULL)) {
326
326
                                g_free(utf8);
327
327
                                utf8 = NULL;
330
330
                        }
331
331
                }
332
332
                if (!utf8)
333
 
                        utf8 = g_convert(text, textlen, "UTF-8", "UCS-2BE", NULL, NULL, NULL);
 
333
                        utf8 = g_convert(text, textlen, "UTF-8", "UTF-16BE", NULL, NULL, NULL);
334
334
        } else if (g_ascii_strcasecmp(encoding, "utf-8")) {
335
335
                purple_debug_warning("oscar", "Unrecognized character encoding \"%s\", "
336
336
                                                   "attempting to convert to UTF-8 anyway\n", encoding);
417
417
        gchar *ret = NULL;
418
418
        const gchar *charsetstr1, *charsetstr2;
419
419
 
420
 
        purple_debug_info("oscar", "Parsing IM part, charset=0x%04hx, charsubset=0x%04hx, datalen=%hd\n", charset, charsubset, datalen);
 
420
        purple_debug_info("oscar", "Parsing IM part, charset=0x%04hx, charsubset=0x%04hx, datalen=%" G_GSIZE_FORMAT "\n", charset, charsubset, datalen);
421
421
 
422
422
        if ((datalen == 0) || (data == NULL))
423
423
                return NULL;
424
424
 
425
425
        if (charset == AIM_CHARSET_UNICODE) {
426
 
                charsetstr1 = "UCS-2BE";
 
426
                charsetstr1 = "UTF-16BE";
427
427
                charsetstr2 = "UTF-8";
428
428
        } else if (charset == AIM_CHARSET_CUSTOM) {
429
429
                if ((sourcesn != NULL) && aim_snvalid_icq(sourcesn))
495
495
         * If we're sending to an ICQ user, and they are in our
496
496
         * buddy list, and they are advertising the Unicode
497
497
         * capability, and they are online, then attempt to send
498
 
         * as UCS-2BE.
 
498
         * as UTF-16BE.
499
499
         */
500
500
        if ((destsn != NULL) && aim_snvalid_icq(destsn))
501
501
                userinfo = aim_locate_finduserinfo(od, destsn);
506
506
                b = purple_find_buddy(account, destsn);
507
507
                if ((b != NULL) && (PURPLE_BUDDY_IS_ONLINE(b)))
508
508
                {
509
 
                        *msg = g_convert(from, -1, "UCS-2BE", "UTF-8", NULL, &msglen, NULL);
 
509
                        *msg = g_convert(from, -1, "UTF-16BE", "UTF-8", NULL, &msglen, NULL);
510
510
                        if (*msg != NULL)
511
511
                        {
512
512
                                *charset = AIM_CHARSET_UNICODE;
538
538
        }
539
539
 
540
540
        /*
541
 
         * Nothing else worked, so send as UCS-2BE.
 
541
         * Nothing else worked, so send as UTF-16BE.
542
542
         */
543
 
        *msg = g_convert(from, -1, "UCS-2BE", "UTF-8", NULL, &msglen, &err);
 
543
        *msg = g_convert(from, -1, "UTF-16BE", "UTF-8", NULL, &msglen, &err);
544
544
        if (*msg != NULL) {
545
545
                *charset = AIM_CHARSET_UNICODE;
546
546
                *charsubset = 0x0000;
1040
1040
        if (conn->type == SNAC_FAMILY_AUTH)
1041
1041
        {
1042
1042
                aim_request_login(od, conn, purple_account_get_username(account));
1043
 
                purple_debug_info("oscar", "Screen name sent, waiting for response\n");
1044
 
                purple_connection_update_progress(gc, _("Screen name sent"), 1, OSCAR_CONNECT_STEPS);
 
1043
                purple_debug_info("oscar", "Username sent, waiting for response\n");
 
1044
                purple_connection_update_progress(gc, _("Username sent"), 1, OSCAR_CONNECT_STEPS);
1045
1045
                ck[1] = 0x65;
1046
1046
        }
1047
1047
        else if (conn->type == SNAC_FAMILY_LOCATE)
1303
1303
 
1304
1304
        if (!aim_snvalid(purple_account_get_username(account))) {
1305
1305
                gchar *buf;
1306
 
                buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the screen name is invalid.  Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
 
1306
                buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
1307
1307
                purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf);
1308
1308
                g_free(buf);
1309
1309
                return;
1382
1382
        va_end(ap);
1383
1383
 
1384
1384
        purple_debug_info("oscar",
1385
 
                           "inside auth_resp (Screen name: %s)\n", info->sn);
 
1385
                           "inside auth_resp (Username: %s)\n", info->sn);
1386
1386
 
1387
1387
        if (info->errorcode || !info->bosip || !info->cookielen || !info->cookie) {
1388
1388
                char buf[256];
1389
1389
                switch (info->errorcode) {
1390
1390
                case 0x01:
1391
1391
                        /* Unregistered screen name */
1392
 
                        purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Invalid screen name."));
 
1392
                        purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Invalid username."));
1393
1393
                        break;
1394
1394
                case 0x05:
1395
1395
                        /* Incorrect password */
1563
1563
{
1564
1564
        struct pieceofcrap *pos = data;
1565
1565
        gchar *buf;
1566
 
        ssize_t result;
 
1566
        gssize result;
1567
1567
 
1568
1568
        if (!PURPLE_CONNECTION_IS_VALID(pos->gc))
1569
1569
        {
1597
1597
                else
1598
1598
                        purple_debug_error("oscar", "Tried to write %"
1599
1599
                                        G_GSIZE_FORMAT " bytes to fetch AIM hash data but "
1600
 
                                        "instead wrote %" G_GSIZE_FORMAT " bytes\n",
 
1600
                                        "instead wrote %" G_GSSIZE_FORMAT " bytes\n",
1601
1601
                                        strlen(buf), result);
1602
1602
        }
1603
1603
        g_free(buf);
2014
2014
                gconstpointer data = purple_imgstore_get_data(img);
2015
2015
                size_t len = purple_imgstore_get_size(img);
2016
2016
                purple_debug_info("oscar",
2017
 
                                   "Sending buddy icon to %s (%d bytes)\n",
2018
 
                                   userinfo->sn, len);
 
2017
                                "Sending buddy icon to %s (%" G_GSIZE_FORMAT " bytes)\n",
 
2018
                                userinfo->sn, len);
2019
2019
                aim_im_sendch2_icon(od, userinfo->sn, data, len,
2020
2020
                        purple_buddy_icons_get_account_icon_timestamp(account),
2021
2021
                        aimutil_iconsum(data, len));
2953
2953
        va_end(ap);
2954
2954
 
2955
2955
        user_info = purple_notify_user_info_new();
2956
 
        purple_notify_user_info_add_pair(user_info, _("Screen Name"), userinfo->sn);
 
2956
        purple_notify_user_info_add_pair(user_info, _("Username"), userinfo->sn);
2957
2957
 
2958
2958
        tmp = g_strdup_printf("%d", (int)((userinfo->warnlevel/10.0) + 0.5));
2959
2959
        purple_notify_user_info_add_pair(user_info, _("Warning Level"), tmp);
3941
3941
        gchar *secondary;
3942
3942
        int i, num;
3943
3943
        va_list ap;
3944
 
        char *email, *SNs;
 
3944
        char *email, *usernames;
3945
3945
 
3946
3946
        va_start(ap, fr);
3947
3947
        email = va_arg(ap, char *);
3948
3948
        num = va_arg(ap, int);
3949
 
        SNs = va_arg(ap, char *);
 
3949
        usernames = va_arg(ap, char *);
3950
3950
        va_end(ap);
3951
3951
 
3952
3952
        results = purple_notify_searchresults_new();
3961
3961
        }
3962
3962
 
3963
3963
        secondary = g_strdup_printf(
3964
 
                                        dngettext(PACKAGE, "The following screen name is associated with %s",
3965
 
                                                 "The following screen names are associated with %s",
 
3964
                                        dngettext(PACKAGE, "The following username is associated with %s",
 
3965
                                                 "The following usernames are associated with %s",
3966
3966
                                                 num),
3967
3967
                                        email);
3968
3968
 
3969
 
        column = purple_notify_searchresults_column_new(_("Screen name"));
 
3969
        column = purple_notify_searchresults_column_new(_("Username"));
3970
3970
        purple_notify_searchresults_column_add(results, column);
3971
3971
 
3972
3972
        for (i = 0; i < num; i++) {
3973
 
                GList *row = NULL;
3974
 
                row = g_list_append(row, g_strdup(&SNs[i * (MAXSNLEN + 1)]));
 
3973
                GList *row;
 
3974
                row = g_list_append(NULL, g_strdup(&usernames[i * (MAXSNLEN + 1)]));
3975
3975
                purple_notify_searchresults_row_add(results, row);
3976
3976
        }
3977
3977
        purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_ADD,
4046
4046
 
4047
4047
        if ((err > 0) && (url != NULL)) {
4048
4048
                char *dialog_msg;
4049
 
                char *dialog_top = g_strdup_printf(_("Error Changing Account Info"));
4050
 
                switch (err) {
4051
 
                        case 0x0001: {
4052
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because the requested screen name differs from the original."), err);
4053
 
                        } break;
4054
 
                        case 0x0006: {
4055
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because it is invalid."), err);
4056
 
                        } break;
4057
 
                        case 0x000b: {
4058
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format screen name because the requested screen name is too long."), err);
4059
 
                        } break;
4060
 
                        case 0x001d: {
4061
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because there is already a request pending for this screen name."), err);
4062
 
                        } break;
4063
 
                        case 0x0021: {
4064
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because the given address has too many screen names associated with it."), err);
4065
 
                        } break;
4066
 
                        case 0x0023: {
4067
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because the given address is invalid."), err);
4068
 
                        } break;
4069
 
                        default: {
4070
 
                                dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err);
4071
 
                        } break;
4072
 
                }
4073
 
                purple_notify_error(gc, NULL, dialog_top, dialog_msg);
4074
 
                g_free(dialog_top);
 
4049
 
 
4050
                if (err == 0x0001)
 
4051
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because the requested name differs from the original."), err);
 
4052
                else if (err == 0x0006)
 
4053
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because it is invalid."), err);
 
4054
                else if (err == 0x00b)
 
4055
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because the requested name is too long."), err);
 
4056
                else if (err == 0x001d)
 
4057
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because there is already a request pending for this username."), err);
 
4058
                else if (err == 0x0021)
 
4059
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because the given address has too many usernames associated with it."), err);
 
4060
                else if (err == 0x0023)
 
4061
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change e-mail address because the given address is invalid."), err);
 
4062
                else
 
4063
                        dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err);
 
4064
                purple_notify_error(gc, NULL,
 
4065
                                _("Error Changing Account Info"), dialog_msg);
4075
4066
                g_free(dialog_msg);
4076
4067
                return 1;
4077
4068
        }
4445
4436
 
4446
4437
        charset = oscar_charset_check(str);
4447
4438
        if (charset == AIM_CHARSET_UNICODE) {
4448
 
                encoded = g_convert(str, -1, "UCS-2BE", "UTF-8", NULL, ret_len, NULL);
 
4439
                encoded = g_convert(str, -1, "UTF-16BE", "UTF-8", NULL, ret_len, NULL);
4449
4440
                *encoding = "unicode-2-0";
4450
4441
        } else if (charset == AIM_CHARSET_CUSTOM) {
4451
4442
                encoded = g_convert(str, -1, "ISO-8859-1", "UTF-8", NULL, ret_len, NULL);
4514
4505
{
4515
4506
        PurpleConnection *gc = purple_account_get_connection(account);
4516
4507
        OscarData *od = gc->proto_data;
4517
 
        PurplePresence *presence;
4518
4508
        PurpleStatusType *status_type;
4519
4509
        PurpleStatusPrimitive primitive;
4520
4510
 
4530
4520
 
4531
4521
        status_type = purple_status_get_type(status);
4532
4522
        primitive = purple_status_type_get_primitive(status_type);
4533
 
        presence = purple_account_get_presence(account);
4534
4523
 
4535
4524
        if (!setinfo)
4536
4525
        {
4680
4669
 
4681
4670
        if (!aim_snvalid(buddy->name)) {
4682
4671
                gchar *buf;
4683
 
                buf = g_strdup_printf(_("Could not add the buddy %s because the screen name is invalid.  Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name);
 
4672
                buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name);
4684
4673
                if (!purple_conv_present_error(buddy->name, account, buf))
4685
4674
                        purple_notify_error(gc, NULL, _("Unable To Add"), buf);
4686
4675
                g_free(buf);
4991
4980
                switch (curitem->type) {
4992
4981
                        case 0x0000: { /* Buddy */
4993
4982
                                if (curitem->name) {
4994
 
                                        struct aim_ssi_item *groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000);
4995
 
                                        char *gname = groupitem ? groupitem->name : NULL;
4996
 
                                        char *gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
4997
 
                                        char *alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name);
4998
 
                                        char *alias_utf8;
 
4983
                                        struct aim_ssi_item *groupitem;
 
4984
                                        char *gname, *gname_utf8, *alias, *alias_utf8;
 
4985
 
 
4986
                                        groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000);
 
4987
                                        gname = groupitem ? groupitem->name : NULL;
 
4988
                                        if (gname != NULL) {
 
4989
                                                if (g_utf8_validate(gname, -1, NULL))
 
4990
                                                        gname_utf8 = g_strdup(gname);
 
4991
                                                else
 
4992
                                                        gname_utf8 = oscar_utf8_try_convert(gc->account, gname);
 
4993
                                        } else
 
4994
                                                gname_utf8 = NULL;
4999
4995
 
5000
4996
                                        g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans"));
5001
4997
                                        if (g == NULL) {
5003
4999
                                                purple_blist_add_group(g, NULL);
5004
5000
                                        }
5005
5001
 
5006
 
                                        if (alias != NULL)
5007
 
                                        {
 
5002
                                        alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name);
 
5003
                                        if (alias != NULL) {
5008
5004
                                                if (g_utf8_validate(alias, -1, NULL))
5009
5005
                                                        alias_utf8 = g_strdup(alias);
5010
5006
                                                else
5011
5007
                                                        alias_utf8 = oscar_utf8_try_convert(account, alias);
5012
5008
                                                g_free(alias);
5013
 
                                        }
5014
 
                                        else
 
5009
                                        } else
5015
5010
                                                alias_utf8 = NULL;
5016
5011
 
5017
5012
                                        b = purple_find_buddy_in_group(gc->account, curitem->name, g);
5050
5045
                        } break;
5051
5046
 
5052
5047
                        case 0x0001: { /* Group */
5053
 
                                char *gname = curitem->name;
5054
 
                                char *gname_utf8 = gname ? oscar_utf8_try_convert(gc->account, gname) : NULL;
 
5048
                                char *gname;
 
5049
                                char *gname_utf8;
 
5050
 
 
5051
                                gname = curitem->name;
 
5052
                                if (gname != NULL) {
 
5053
                                        if (g_utf8_validate(gname, -1, NULL))
 
5054
                                                gname_utf8 = g_strdup(gname);
 
5055
                                        else
 
5056
                                                gname_utf8 = oscar_utf8_try_convert(gc->account, gname);
 
5057
                                } else
 
5058
                                        gname_utf8 = NULL;
 
5059
 
5055
5060
                                if (gname_utf8 != NULL && purple_find_group(gname_utf8) == NULL) {
5056
5061
                                        g = purple_group_new(gname_utf8);
5057
5062
                                        purple_blist_add_group(g, NULL);
6225
6230
        if (!aim_sncmp(purple_account_get_username(purple_connection_get_account(gc)), nick)) {
6226
6231
                if (!flap_connection_getbytype(od, SNAC_FAMILY_ADMIN)) {
6227
6232
                        od->setnick = TRUE;
 
6233
                        g_free(od->newsn);
6228
6234
                        od->newsn = g_strdup(nick);
6229
6235
                        aim_srv_requestnew(od, SNAC_FAMILY_ADMIN);
6230
6236
                } else {
6232
6238
                }
6233
6239
        } else {
6234
6240
                purple_notify_error(gc, NULL, _("The new formatting is invalid."),
6235
 
                                                  _("Screen name formatting can change only capitalization and whitespace."));
 
6241
                                                  _("Username formatting can change only capitalization and whitespace."));
6236
6242
        }
6237
6243
}
6238
6244
 
6515
6521
 
6516
6522
        if (od->icq)
6517
6523
        {
6518
 
                act = purple_plugin_action_new(_("Set User Info (URL)..."),
 
6524
                act = purple_plugin_action_new(_("Set User Info (web)..."),
6519
6525
                                oscar_show_set_info_icqurl);
6520
6526
                menu = g_list_prepend(menu, act);
6521
6527
        }
6526
6532
 
6527
6533
        if (od->authinfo->chpassurl != NULL)
6528
6534
        {
6529
 
                act = purple_plugin_action_new(_("Change Password (URL)"),
 
6535
                act = purple_plugin_action_new(_("Change Password (web)"),
6530
6536
                                oscar_show_chpassurl);
6531
6537
                menu = g_list_prepend(menu, act);
6532
6538
 
6533
 
                act = purple_plugin_action_new(_("Configure IM Forwarding (URL)"),
 
6539
                act = purple_plugin_action_new(_("Configure IM Forwarding (web)"),
6534
6540
                                oscar_show_imforwardingurl);
6535
6541
                menu = g_list_prepend(menu, act);
6536
6542
        }
6631
6637
        g_return_val_if_fail(str != NULL, NULL);
6632
6638
 
6633
6639
        /* copy str to buf and skip all blanks */
6634
 
        for (i=0, j=0; str[j] && i < BUF_LEN; i++, j++)
 
6640
        for (i=0, j=0; str[j] && i < BUF_LEN - 1; i++, j++)
6635
6641
        {
6636
6642
                while (str[j] == ' ')
6637
6643
                        j++;
6651
6657
gboolean
6652
6658
oscar_offline_message(const PurpleBuddy *buddy)
6653
6659
{
6654
 
        OscarData *od = NULL;
6655
 
        PurpleAccount *account;
6656
 
        PurpleConnection *gc = NULL;
6657
 
 
6658
 
        account = purple_buddy_get_account(buddy);
6659
 
        if (account != NULL) {
6660
 
                gc = purple_account_get_connection(account);
6661
 
                if (gc != NULL)
6662
 
                        od = (OscarData *)gc->proto_data;
6663
 
        }
6664
 
 
6665
 
        return (od != NULL && od->icq && aim_snvalid_icq(purple_account_get_username(account)));
 
6660
        return TRUE;
6666
6661
}
6667
6662
 
6668
6663
/* TODO: Find somewhere to put this instead of including it in a bunch of places.