Mercurial > pidgin
changeset 29314:c783f9e66171
Don't play the message received sound for NOTIFY messages (this will avoid
playing the "normal" sound for attention messages).
Don't handle the sent-attention signal in Pidgin, since fixing playing
duplicate sounds (the ordinary message sent sound) will need changing
the message-recv signal in conversation.c
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 16 Nov 2009 21:57:32 +0000 |
parents | 47b3a53ce497 |
children | 7b1cfd48beab |
files | libpurple/sound.h pidgin/gtksound.c |
diffstat | 2 files changed, 6 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/sound.h Mon Nov 16 21:14:35 2009 +0000 +++ b/libpurple/sound.h Mon Nov 16 21:57:32 2009 +0000 @@ -51,7 +51,6 @@ PURPLE_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */ PURPLE_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ PURPLE_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ - PURPLE_SOUND_SEND_ATTENTION, /**< Send an attention */ PURPLE_SOUND_GOT_ATTENTION, /**< Got an attention */ PURPLE_NUM_SOUNDS /**< Total number of sounds. */
--- a/pidgin/gtksound.c Mon Nov 16 21:14:35 2009 +0000 +++ b/pidgin/gtksound.c Mon Nov 16 21:57:32 2009 +0000 @@ -73,8 +73,7 @@ /* this isn't a terminator, it's the buddy pounce default sound event ;-) */ {NULL, "pounce_default", "alert.wav"}, {N_("Someone says your username in chat"), "nick_said", "alert.wav"}, - {N_("Attention received"), "got_attention", "alert.wav"}, - {N_("Attention sent"), "sent_attention", "alert.wav"} + {N_("Attention received"), "got_attention", "alert.wav"} }; static gboolean @@ -146,7 +145,7 @@ char *message, PurpleConversation *conv, PurpleMessageFlags flags, PurpleSoundEventID event) { - if (flags & PURPLE_MESSAGE_DELAYED) + if (flags & PURPLE_MESSAGE_DELAYED || flags & PURPLE_MESSAGE_NOTIFY) return; if (conv==NULL) @@ -201,7 +200,7 @@ { PurpleConvChat *chat; - if (flags & PURPLE_MESSAGE_DELAYED) + if (flags & PURPLE_MESSAGE_DELAYED || flags & PURPLE_MESSAGE_NOTIFY) return; chat = purple_conversation_get_chat_data(conv); @@ -222,13 +221,6 @@ } static void -sent_attention_cb(PurpleAccount *account, const char *who, - PurpleConversation *conv, guint type, PurpleSoundEventID event) -{ - play_conv_event(conv, event); -} - -static void got_attention_cb(PurpleAccount *account, const char *who, PurpleConversation *conv, guint type, PurpleSoundEventID event) { @@ -365,12 +357,12 @@ purple_signal_connect(conv_handle, "received-chat-msg", gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb), GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY)); - purple_signal_connect(conv_handle, "sent-attention", gtk_sound_handle, - PURPLE_CALLBACK(sent_attention_cb), - GINT_TO_POINTER(PURPLE_SOUND_SEND_ATTENTION)); purple_signal_connect(conv_handle, "got-attention", gtk_sound_handle, PURPLE_CALLBACK(got_attention_cb), GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION)); + /* for the time being, don't handle sent-attention here, since playing a + sound would result induplicate sounds. And fixing that would require changing the + conversation signal for msg-recv */ } static void