示例#1
0
static void
chat_buddy_left_cb(PurpleConversation *conv, const char *name,
				   const char *reason, PurpleSoundEventID event)
{
	if (!chat_nick_matches_name(conv, name))
		play_conv_event(conv, event);
}
示例#2
0
static void
chat_user_left_cb(PurpleChatConversation *chat, const char *name,
				   const char *reason, PurpleSoundEventID event)
{
	if (!chat_nick_matches_name(chat, name))
		play_conv_event(PURPLE_CONVERSATION(chat), event);
}
示例#3
0
static void
chat_buddy_join_cb(PurpleConversation *conv, const char *name,
				   PurpleConvChatBuddyFlags flags, gboolean new_arrival,
				   PurpleSoundEventID event)
{
	if (new_arrival && !chat_nick_matches_name(conv, name))
		play_conv_event(conv, event);
}
示例#4
0
static void
chat_user_join_cb(PurpleChatConversation *chat, const char *name,
				   PurpleChatUserFlags flags, gboolean new_arrival,
				   PurpleSoundEventID event)
{
	if (new_arrival && !chat_nick_matches_name(chat, name))
		play_conv_event(PURPLE_CONVERSATION(chat), event);
}
示例#5
0
static void
chat_msg_received_cb(PurpleAccount *account, char *sender,
					 char *message, PurpleChatConversation *chat,
					 PurpleMessageFlags flags, PurpleSoundEventID event)
{
	if (flags & PURPLE_MESSAGE_DELAYED)
		return;

	g_return_if_fail(chat != NULL);

	if (purple_chat_conversation_is_ignored_user(chat, sender))
		return;

	if (chat_nick_matches_name(chat, sender))
		return;

	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, purple_chat_conversation_get_nick(chat)))
		play_conv_event(PURPLE_CONVERSATION(chat), PURPLE_SOUND_CHAT_NICK);
	else
		play_conv_event(PURPLE_CONVERSATION(chat), event);
}
示例#6
0
static void
chat_msg_received_cb(PurpleAccount *account, char *sender,
					 char *message, PurpleConversation *conv,
					 PurpleMessageFlags flags, PurpleSoundEventID event)
{
	PurpleConvChat *chat;

	if (flags & PURPLE_MESSAGE_DELAYED)
		return;

	chat = purple_conversation_get_chat_data(conv);
	g_return_if_fail(chat != NULL);

	if (purple_conv_chat_is_user_ignored(chat, sender))
		return;

	if (chat_nick_matches_name(conv, sender))
		return;

	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
	else
		play_conv_event(conv, event);
}
示例#7
0
static void
chat_msg_received_cb(PurpleAccount *account, char *sender,
					 char *message, PurpleChatConversation *chat,
					 PurpleMessageFlags flags, PurpleSoundEventID event)
{
	PurpleConversation *conv = PURPLE_CONVERSATION(chat);
	if (flags & PURPLE_MESSAGE_DELAYED || flags & PURPLE_MESSAGE_NOTIFY)
		return;

	g_return_if_fail(conv != NULL);

	if (purple_chat_conversation_is_ignored_user(chat, sender))
		return;

	if (chat_nick_matches_name(chat, sender))
		return;

	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, purple_chat_conversation_get_nick(chat)))
		/* This isn't quite right; if you have the PURPLE_SOUND_CHAT_NICK event disabled
		 * and the PURPLE_SOUND_CHAT_SAY event enabled, you won't get a sound at all */
		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
	else
		play_conv_event(conv, event);
}