Mercurial > pidgin.yaz
comparison src/gtkpounce.c @ 9191:06b28fb24300
[gaim-migrate @ 9986]
" This patch was inspired by Robert Story's previous
timestamp patch (#944943). That was rejected because
of a timing inconsistency issue mentioned by Faceprint.
This patch disables timestamps in a given conversation
when no messages have been displayed since the last
timestamp. When a new message is about to be displayed
in a disabled timestamp conversation, a timestamp is
inserted first to maintain timing consistency. Then
the timestamp display is reenabled and the IM message
is printed.
This patch also handles a bug in the original timestamp
plugin. Previously, when the timestamp interval was
modified in the preferences, no current open
conversations are affected. I have modified it so that
all open conversations use the new interval. I would
have sent this as a separate patch, but this is my
first patch and didn't want to mess it up :)." --Eddie Sohn
i liked the original patch and was somewhat disappointed that it didn't get
fixed to address Nathan's concern, so i'm happy to merge this one in.
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sun, 06 Jun 2004 02:08:57 +0000 |
parents | f17670a9e4ef |
children | 5b35a6b96726 |
comparison
equal
deleted
inserted
replaced
9190:9e3289499977 | 9191:06b28fb24300 |
---|---|
877 pounce_cb(GaimPounce *pounce, GaimPounceEvent events, void *data) | 877 pounce_cb(GaimPounce *pounce, GaimPounceEvent events, void *data) |
878 { | 878 { |
879 GaimConversation *conv; | 879 GaimConversation *conv; |
880 GaimAccount *account; | 880 GaimAccount *account; |
881 GaimBuddy *buddy; | 881 GaimBuddy *buddy; |
882 GaimPlugin *proto; | |
882 const char *pouncee; | 883 const char *pouncee; |
883 const char *alias; | 884 const char *alias; |
884 | 885 const char *proto_id; |
886 | |
885 pouncee = gaim_pounce_get_pouncee(pounce); | 887 pouncee = gaim_pounce_get_pouncee(pounce); |
886 account = gaim_pounce_get_pouncer(pounce); | 888 account = gaim_pounce_get_pouncer(pounce); |
887 | 889 |
888 buddy = gaim_find_buddy(account, pouncee); | 890 buddy = gaim_find_buddy(account, pouncee); |
889 | 891 |
890 alias = gaim_get_buddy_alias(buddy); | 892 alias = gaim_get_buddy_alias(buddy); |
891 | 893 |
894 /*find the protocol id for the window title and/or message*/ | |
895 proto = gaim_find_prpl(gaim_account_get_protocol_id(account)); | |
896 proto_id = proto->info->name; | |
897 | |
892 if (gaim_pounce_action_is_enabled(pounce, "open-window")) { | 898 if (gaim_pounce_action_is_enabled(pounce, "open-window")) { |
893 conv = gaim_find_conversation_with_account(pouncee, account); | 899 conv = gaim_find_conversation_with_account(pouncee, account); |
894 | 900 |
895 if (conv == NULL) | 901 if (conv == NULL) |
896 conv = gaim_conversation_new(GAIM_CONV_IM, account, pouncee); | 902 conv = gaim_conversation_new(GAIM_CONV_IM, account, pouncee); |
897 } | 903 } |
898 | 904 |
899 if (gaim_pounce_action_is_enabled(pounce, "popup-notify")) { | 905 if (gaim_pounce_action_is_enabled(pounce, "popup-notify")) { |
900 char tmp[1024]; | 906 char tmp[1024]; |
901 | 907 |
908 /*Here we place the protocol name in the pounce dialog to lessen confusion about what | |
909 protocol a pounce is for*/ | |
902 g_snprintf(tmp, sizeof(tmp), | 910 g_snprintf(tmp, sizeof(tmp), |
903 (events & GAIM_POUNCE_TYPING) ? _("%s has started typing to you") : | 911 (events & GAIM_POUNCE_TYPING) ? _("%s has started typing to you (%s)") : |
904 (events & GAIM_POUNCE_SIGNON) ? _("%s has signed on") : | 912 (events & GAIM_POUNCE_SIGNON) ? _("%s has signed on (%s)") : |
905 (events & GAIM_POUNCE_IDLE_RETURN) ? _("%s has returned from being idle") : | 913 (events & GAIM_POUNCE_IDLE_RETURN) ? _("%s has returned from being idle (%s)") : |
906 (events & GAIM_POUNCE_AWAY_RETURN) ? _("%s has returned from being away") : | 914 (events & GAIM_POUNCE_AWAY_RETURN) ? _("%s has returned from being away (%s)") : |
907 (events & GAIM_POUNCE_TYPING_STOPPED) ? _("%s has stopped typing to you") : | 915 (events & GAIM_POUNCE_TYPING_STOPPED) ? _("%s has stopped typing to you %s") : |
908 (events & GAIM_POUNCE_SIGNOFF) ? _("%s has signed off") : | 916 (events & GAIM_POUNCE_SIGNOFF) ? _("%s has signed off (%s)") : |
909 (events & GAIM_POUNCE_IDLE) ? _("%s has become idle") : | 917 (events & GAIM_POUNCE_IDLE) ? _("%s has become idle (%s)") : |
910 (events & GAIM_POUNCE_AWAY) ? _("%s has gone away.") : | 918 (events & GAIM_POUNCE_AWAY) ? _("%s has gone away. (%s)") : |
911 _("Unknown pounce event. Please report this!"), | 919 _("Unknown pounce event. Please report this!"), |
912 alias); | 920 alias,proto_id); |
913 | 921 |
914 gaim_notify_info(NULL, NULL, tmp, (char*)gaim_date_full()); | 922 /*Ok here is where I change the second argument, title, |
923 from NULL to the account name if that's all we have | |
924 or the account alias if we have that*/ | |
925 if(gaim_account_get_alias(account)) { | |
926 gaim_notify_info(NULL, gaim_account_get_alias(account), tmp, (char*)gaim_date_full()); | |
927 } else { | |
928 gaim_notify_info(NULL, gaim_account_get_username(account), tmp, (char*)gaim_date_full()); | |
929 } | |
915 } | 930 } |
916 | 931 |
917 if (gaim_pounce_action_is_enabled(pounce, "send-message")) { | 932 if (gaim_pounce_action_is_enabled(pounce, "send-message")) { |
918 const char *message; | 933 const char *message; |
919 | 934 |