diff options
author | Marcus Lundblad <malu@pidgin.im> | 2009-11-16 21:57:32 +0000 |
---|---|---|
committer | Marcus Lundblad <malu@pidgin.im> | 2009-11-16 21:57:32 +0000 |
commit | cb375857620c36872b023e158334468e2a2f1b7f (patch) | |
tree | 6ebb10b49202b44898e89132ba54ebcbe3f88a63 | |
parent | d57ec0c9df610d1b90b908191707ec69a92f3fb3 (diff) | |
download | pidgin-cpw.attention_ui.tar.gz |
Don't play the message received sound for NOTIFY messages (this will avoidcpw.attention_ui
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
-rw-r--r-- | libpurple/sound.h | 1 | ||||
-rw-r--r-- | pidgin/gtksound.c | 20 |
2 files changed, 6 insertions, 15 deletions
diff --git a/libpurple/sound.h b/libpurple/sound.h index 6c68145379..1879725818 100644 --- a/libpurple/sound.h +++ b/libpurple/sound.h @@ -51,7 +51,6 @@ typedef enum _PurpleSoundEventID 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. */ diff --git a/pidgin/gtksound.c b/pidgin/gtksound.c index 70718bfef2..42621ae388 100644 --- a/pidgin/gtksound.c +++ b/pidgin/gtksound.c @@ -73,8 +73,7 @@ static const struct pidgin_sound_event sounds[PURPLE_NUM_SOUNDS] = { /* 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 @@ im_msg_received_cb(PurpleAccount *account, char *sender, 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 @@ chat_msg_received_cb(PurpleAccount *account, char *sender, { 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 @@ chat_msg_received_cb(PurpleAccount *account, char *sender, } 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 @@ pidgin_sound_init(void) 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 |