cpw.attention_ui: 3d97b094: Don't play the message received sound fo...
malu at pidgin.im
malu at pidgin.im
Mon Nov 16 17:01:43 EST 2009
-----------------------------------------------------------------
Revision: 3d97b094123bd082b1438ea44cb25169aa41315c
Ancestor: 58a6754ab4d9a4486591e6aeb51159fb3721de27
Author: malu at pidgin.im
Date: 2009-11-16T21:57:32
Branch: im.pidgin.cpw.attention_ui
URL: http://d.pidgin.im/viewmtn/revision/info/3d97b094123bd082b1438ea44cb25169aa41315c
Modified files:
libpurple/sound.h pidgin/gtksound.c
ChangeLog:
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
-------------- next part --------------
============================================================
--- libpurple/sound.h ecabdd69d48a1dd144cbacc7126bb9d66c95e831
+++ libpurple/sound.h 0a8978edca6b89b5bcb6125057c49c8109b7d29e
@@ -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. */
============================================================
--- pidgin/gtksound.c e99b7cfbf5916ad8ea0710c7fc5db815a436ff89
+++ pidgin/gtksound.c 92dc003af162d1d1d5fbb1c7f9ba2b5b11a15e39
@@ -73,8 +73,7 @@ static const struct pidgin_sound_event s
/* 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 *accoun
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 *acco
{
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
}
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
More information about the Commits
mailing list