Mercurial > pidgin.yaz
changeset 10007:267a2b69e36e
[gaim-migrate @ 10924]
Better i18nability and more uniform code?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 10 Sep 2004 04:30:37 +0000 |
parents | 9baedaca25c7 |
children | 50c1724d5e59 |
files | src/prpl.c |
diffstat | 1 files changed, 23 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/prpl.c Fri Sep 10 04:09:36 2004 +0000 +++ b/src/prpl.c Fri Sep 10 04:30:37 2004 +0000 @@ -57,12 +57,7 @@ presence = gaim_account_get_presence(account); - /* - * TODO: Set a presence's sign-on time. We don't support this yet. - */ - gaim_debug_warning("prpl", - "Attempting to set an account's sign-on time, but we " - "don't support this yet! FIX IT!\n"); + gaim_presence_set_login_time(presence, login_time); } static gboolean @@ -197,7 +192,7 @@ { GaimPresence *presence; unsigned int old_level; - char buf2[1024]; + gchar *buf; g_return_if_fail(account != NULL); @@ -212,14 +207,20 @@ if (old_level >= level) return; - g_snprintf(buf2, sizeof(buf2), - _("%s has just been warned by %s.\n" - "Your new warning level is %d%%"), - gaim_account_get_username(account), - (username == NULL ? _("an anonymous person") : username), - level); + if (username == NULL) + buf = g_strdup_printf(_("%s has just been warned by an anonymous " + "person.\nYour new warning level is %d%%"), + gaim_account_get_username(account), + level); + else + buf = g_strdup_printf(_("%s has just been warned by %s.\n" + "Your new warning level is %d%%"), + gaim_account_get_username(account), + username, level); - gaim_notify_info(NULL, NULL, buf2, NULL); + gaim_notify_info(NULL, NULL, buf, NULL); + + g_free(buf); } void @@ -227,6 +228,7 @@ gboolean idle, time_t idle_time) { GaimBuddy *buddy; + GaimPresence *presence; g_return_if_fail(account != NULL); g_return_if_fail(name != NULL); @@ -235,7 +237,9 @@ if ((buddy = gaim_find_buddy(account, name)) == NULL) return; - gaim_presence_set_idle(gaim_buddy_get_presence(buddy), idle, idle_time); + presence = gaim_buddy_get_presence(buddy); + + gaim_presence_set_idle(presence, idle, idle_time); } void @@ -304,6 +308,7 @@ unsigned int level) { GaimBuddy *buddy; + GaimPresence *presence; g_return_if_fail(account != NULL); g_return_if_fail(name != NULL); @@ -311,7 +316,9 @@ if ((buddy = gaim_find_buddy(account, name)) == NULL) return; - gaim_presence_set_warning_level(gaim_buddy_get_presence(buddy), level); + presence = gaim_buddy_get_presence(buddy); + + gaim_presence_set_warning_level(presence, level); } void @@ -380,7 +387,6 @@ /* Just In Case (TM) */ if (GAIM_IS_PROTOCOL_PLUGIN(plugin)) { - if (!strcmp(plugin->info->id, id)) return plugin; }