# HG changeset patch # User tomkiewicz@cpw.pidgin.im # Date 1318519672 0 # Node ID 318345f39e989aa53a9e328311d47869248727f0 # Parent 9740dd0298278387446edc54dc1fabd2d9661e99 Gadu-Gadu: function to normalize gg usernames diff -r 9740dd029827 -r 318345f39e98 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Wed Oct 12 21:06:20 2011 +0000 +++ b/libpurple/protocols/gg/gg.c Thu Oct 13 15:27:52 2011 +0000 @@ -2082,6 +2082,19 @@ return "gadu-gadu"; } +static const char *ggp_normalize(const PurpleAccount *account, const char *who) +{ + static char normalized[21]; /* maximum unsigned long long int size */ + + uin_t uin = ggp_str_to_uin(who); + if (uin <= 0) + return NULL; + + g_snprintf(normalized, sizeof(normalized), "%u", uin); + + return normalized; +} + static char *ggp_status_text(PurpleBuddy *b) { PurpleStatus *status; @@ -2850,7 +2863,7 @@ NULL, /* rename_group */ NULL, /* buddy_free */ NULL, /* convo_closed */ - NULL, /* normalize */ + ggp_normalize, /* normalize */ NULL, /* set_buddy_icon */ NULL, /* remove_group */ NULL, /* get_cb_real_name */