comparison src/protocols/oscar/oscar.c @ 11153:8e600ee6ec61

[gaim-migrate @ 13235] sf patch #1243998, from Evan Schoenberg, also some changes by me Basically novell needed a prpl->normalize function that didn't remove spaces. But I didn't like having the default normalize code make the string lowercase and remove spaces, so I changed the default to basically do nothing. Anyhoo, if you think of yourself as the primary contact for one of the PRPLs, you may want to make sure your PRPL has a normalize function, if it needs one. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 24 Jul 2005 19:36:22 +0000
parents eac408c8900f
children 92453bf9b86b
comparison
equal deleted inserted replaced
11152:c25b3815d781 11153:8e600ee6ec61
7604 7604
7605 return frame; 7605 return frame;
7606 } 7606 }
7607 #endif 7607 #endif
7608 7608
7609 static const char *
7610 oscar_normalize(const GaimAccount *account, const char *str)
7611 {
7612 static char buf[BUF_LEN];
7613 char *tmp1, *tmp2;
7614 int i, j;
7615
7616 g_return_val_if_fail(str != NULL, NULL);
7617
7618 strncpy(buf, str, BUF_LEN);
7619 for (i=0, j=0; buf[j]; i++, j++)
7620 {
7621 while (buf[j] == ' ')
7622 j++;
7623 buf[i] = buf[j];
7624 }
7625 buf[i] = '\0';
7626
7627 tmp1 = g_utf8_strdown(buf, -1);
7628 tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);
7629 g_snprintf(buf, sizeof(buf), "%s", tmp2);
7630 g_free(tmp2);
7631 g_free(tmp1);
7632
7633 return buf;
7634 }
7635
7609 static GaimPluginProtocolInfo prpl_info = 7636 static GaimPluginProtocolInfo prpl_info =
7610 { 7637 {
7611 OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE, 7638 OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE,
7612 NULL, /* user_splits */ 7639 NULL, /* user_splits */
7613 NULL, /* protocol_options */ 7640 NULL, /* protocol_options */
7654 oscar_alias_buddy, /* alias_buddy */ 7681 oscar_alias_buddy, /* alias_buddy */
7655 oscar_move_buddy, /* group_buddy */ 7682 oscar_move_buddy, /* group_buddy */
7656 oscar_rename_group, /* rename_group */ 7683 oscar_rename_group, /* rename_group */
7657 NULL, /* buddy_free */ 7684 NULL, /* buddy_free */
7658 oscar_convo_closed, /* convo_closed */ 7685 oscar_convo_closed, /* convo_closed */
7659 NULL, /* normalize */ 7686 oscar_normalize, /* normalize */
7660 oscar_set_icon, /* set_buddy_icon */ 7687 oscar_set_icon, /* set_buddy_icon */
7661 NULL, /* remove_group */ 7688 NULL, /* remove_group */
7662 NULL, /* get_cb_real_name */ 7689 NULL, /* get_cb_real_name */
7663 NULL, /* set_chat_topic */ 7690 NULL, /* set_chat_topic */
7664 NULL, /* find_blist_chat */ 7691 NULL, /* find_blist_chat */