Ejemplo n.º 1
0
static void
notify_chat_nick (PurpleAccount *account,
				  const gchar *sender,
				  const gchar *message,
				  PurpleConversation *conv,
				  gpointer data)
{
	gchar *nick;

	nick = (gchar *)purple_conv_chat_get_nick (PURPLE_CONV_CHAT(conv));
#ifndef DEBUG /* in debug mode, always show notifications */
	if (nick && !strcmp (sender, nick))
		return;
#else
	purple_debug_info (PLUGIN_ID, "Message would be suppressed normally because you said it yourself");
#endif

	int triggermessagefound = 0;
	int i;
	for (i = 0; words[i]; i++  ) {
		if (g_strstr_len(message, strlen(message), words[i])) {
			triggermessagefound=1;
			purple_debug_info (PLUGIN_ID, "found triggermessage in chat");
			break;
		}
	}
	if (!triggermessagefound){
		purple_debug_info (PLUGIN_ID, "no triggermessage found in chat");
	}

	if (!triggermessagefound && !g_strstr_len(message, strlen(message), nick) && !purple_prefs_get_bool("/plugins/gtk/libnotify/othermsgs"))
		return;

	notify_msg_sent (account, conv, sender, message);
}
Ejemplo n.º 2
0
SpectrumMUCConversation::SpectrumMUCConversation(PurpleConversation *conv, const std::string &jid, const std::string &resource) : AbstractConversation(SPECTRUM_CONV_GROUPCHAT) {
	m_jid = jid;
	m_res = "/" + resource;
	m_conv = conv;
	m_connected = false;
	m_lastPresence = NULL;
#ifndef TESTS
	m_conv->ui_data = this;
	PurpleConvChat *chat = purple_conversation_get_chat_data(m_conv);
	m_nickname = purple_conv_chat_get_nick(chat);
#endif
}
static void
notify_chat_nick (PurpleAccount *account,
				  const gchar *sender,
				  const gchar *message,
				  PurpleConversation *conv,
				  gpointer data)
{
	gchar *nick;

	nick = (gchar *)purple_conv_chat_get_nick (PURPLE_CONV_CHAT(conv));
	if (nick && !strcmp (sender, nick))
		return;

	if (!g_strstr_len (message, strlen(message), nick))
		return;

	notify_msg_sent (account, conv, sender, message);
}