Esempio n. 1
0
static void
tray_priv (char *from, char *text)
{
	const char *network;

	if (alert_match_word (from, prefs.hex_irc_no_hilight))
		return;

	tray_set_flash (ICON_MSG);

	network = hexchat_get_info (ph, "network");
	if (!network)
		network = hexchat_get_info (ph, "server");

	tray_priv_count++;
	if (tray_priv_count == 1)
		tray_set_tipf (_(DISPLAY_NAME": Private message from: %s (%s)"),
							from, network);
	else
		tray_set_tipf (_(DISPLAY_NAME": %u private messages, latest from: %s (%s)"),
							tray_priv_count, from, network);

	if (prefs.hex_input_balloon_priv)
		tray_set_balloonf (text, _("Private message from: %s (%s)"),
								 from, network);
}
Esempio n. 2
0
static int
tray_dcc_cb (char *word[], void *userdata)
{
	const char *network;

/*	if (tray_status == TS_FILEOFFER)
		return HEXCHAT_EAT_NONE;*/

	network = hexchat_get_info (ph, "network");
	if (!network)
		network = hexchat_get_info (ph, "server");

	if (prefs.hex_input_tray_priv && (!prefs.hex_away_omit_alerts || tray_find_away_status () != 1))
	{
		tray_set_flash (ICON_FILE);

		tray_file_count++;
		if (tray_file_count == 1)
			tray_set_tipf (_(DISPLAY_NAME": File offer from: %s (%s)"),
								word[1], network);
		else
			tray_set_tipf (_(DISPLAY_NAME": %u file offers, latest from: %s (%s)"),
								tray_file_count, word[1], network);
	}

	if (prefs.hex_input_balloon_priv && (!prefs.hex_away_omit_alerts || tray_find_away_status () != 1))
		tray_set_balloonf ("", _("File offer from: %s (%s)"),
								word[1], network);

	return HEXCHAT_EAT_NONE;
}
Esempio n. 3
0
static int
tray_hilight_cb (char *word[], void *userdata)
{
	/*if (tray_status == TS_HIGHLIGHT)
		return HEXCHAT_EAT_NONE;*/

	if (prefs.hex_input_tray_hilight)
	{
		tray_set_flash (ICON_HILIGHT);

		/* FIXME: hides any previous private messages */
		tray_hilight_count++;
		if (tray_hilight_count == 1)
			tray_set_tipf (_(DISPLAY_NAME": Highlighted message from: %s (%s)"),
								word[1], hexchat_get_info (ph, "channel"));
		else
			tray_set_tipf (_(DISPLAY_NAME": %u highlighted messages, latest from: %s (%s)"),
								tray_hilight_count, word[1], hexchat_get_info (ph, "channel"));
	}

	if (prefs.hex_input_balloon_hilight)
		tray_set_balloonf (word[2], _("Highlighted message from: %s (%s)"),
								 word[1], hexchat_get_info (ph, "channel"));

	return HEXCHAT_EAT_NONE;
}
Esempio n. 4
0
static void
process_dcc(gpointer *params)
{
	session *sess = params[0];
	gchar *nick   = params[1];

	const char *network = server_get_network(sess->server, FALSE);
	if (!network)
		network = sess->server->connected ? sess->server->servername : NULL;

	if (prefs.input_tray_priv)
	{
		tray_set_flash(ICON_FILE);

		tray_dcc_count++;
		if (tray_dcc_count == 1)
			tray_set_tipf(_("GChat: DCC offer from: %s (%s)"),
								nick, network ? network : "unknown network");
		else
			tray_set_tipf(_("GChat: %u DCC offers, latest from: %s (%s)"),
								tray_dcc_count, nick, network ? network : "unknown network");
	}

	if (prefs.input_balloon_priv)
		tray_set_balloonf("", _("GChat: DCC offer from: %s (%s)"),
								nick, network ? network : "unknown network");
}
Esempio n. 5
0
static void
process_invited(gpointer *params)
{
	gchar **word  = params[1];
	gchar *from   = params[2];
	server *serv  = params[3];

	gchar *channel = word[4][0] == ':' ? word[4] + 1 : word[4];

	const char *network = server_get_network(serv, FALSE);
	if (!network)
		network = serv->connected ? serv->servername : NULL;

	if (FromNick(from, prefs.irc_no_hilight))
		return;

	if (prefs.input_tray_priv)
	{
		tray_set_flash(ICON_HILIGHT);

		tray_invite_count++;
		if (tray_invite_count == 1)
			tray_set_tipf(_("GChat: Invite from: %s (%s) to %s"),
								from, network, channel);
		else
			tray_set_tipf(_("GChat: %u private messages, latest from: %s (%s) to %s"),
								tray_priv_count, from, network, channel);
	}

	if (prefs.input_balloon_priv)
		tray_set_balloonf("", _("GChat: Invite from: %s (%s) to %s"),
								 from, network, channel);
}
Esempio n. 6
0
static void
process_private(gpointer *params)
{
	session *sess  = params[0];
	gchar *from    = params[1];
	gchar *message = params[2];

	const char *network = server_get_network(sess->server, FALSE);
	if (!network)
		network = sess->server->connected ? sess->server->servername : NULL;

	if (FromNick(from, prefs.irc_no_hilight))
		return;

	if (prefs.input_tray_priv)
	{
		tray_set_flash(ICON_HILIGHT);

		tray_priv_count++;
		if (tray_priv_count == 1)
			tray_set_tipf(_("GChat: Private message from: %s (%s)"),
								from, network);
		else
			tray_set_tipf(_("GChat: %u private messages, latest from: %s (%s)"),
								tray_priv_count, from, network);
	}

	if (prefs.input_balloon_priv)
		tray_set_balloonf(message, _("GChat: Private message from: %s (%s)"),
								 from, network);
}
Esempio n. 7
0
static void
process_message(gpointer *params)
{
	session *sess  = params[0];
	gchar *from    = params[1];
	gchar *message = params[2];

	if (tray_status == TS_HIGHLIGHT)
		return;

	if (prefs.input_tray_chans)
	{
		tray_set_flash(ICON_MSG);

		tray_pub_count++;
		if (tray_pub_count == 1)
			tray_set_tipf(_("GChat: New public message from: %s (%s)"),
								from, sess->channel ? sess->channel : _("unknown channel"));
		else
			tray_set_tipf(_("GChat: %u new public messages."), tray_pub_count);
	}

	if (prefs.input_balloon_chans)
		tray_set_balloonf(message, _("GChat: New public message from: %s (%s)"),
								 from, sess->channel ? sess->channel : _("unknown channel"));
}
Esempio n. 8
0
static void
process_message_highlight(gpointer *params)
{
	session *sess   = params[0];
	gchar *from     = params[1];
	gchar *message  = params[2];

	if (prefs.input_tray_hilight)
	{
		tray_set_flash(ICON_HILIGHT);

		/* FIXME: hides any previous private messages */
		tray_hilight_count++;
		if (tray_hilight_count == 1)
			tray_set_tipf(_("GChat: Highlighted message from: %s (%s)"),
								from, sess->channel ? sess->channel : _("unknown channel"));
		else
			tray_set_tipf(_("GChat: %u highlighted messages, latest from: %s (%s)"),
								tray_hilight_count, from, sess->channel ? sess->channel : _("unknown channel"));
	}

	if (prefs.input_balloon_hilight)
		tray_set_balloonf(message, _("GChat: Highlighted message from: %s (%s)"),
								 from, sess->channel ? sess->channel : _("unknown channel"));
}
Esempio n. 9
0
static int
tray_dcc_cb (char *word[], void *userdata)
{
	const char *network;

/*	if (tray_status == TS_FILEOFFER)
		return XCHAT_EAT_NONE;*/

	network = xchat_get_info (ph, "network");
	if (!network)
		network = xchat_get_info (ph, "server");

	if (prefs.input_tray_priv)
	{
		tray_set_flash (ICON_FILE);

		tray_file_count++;
		if (tray_file_count == 1)
			tray_set_tipf (_("XChat: File offer from: %s (%s)"),
								word[1], network);
		else
			tray_set_tipf (_("XChat: %u file offers, latest from: %s (%s)"),
								tray_file_count, word[1], network);
	}

	if (prefs.input_balloon_priv)
		tray_set_balloonf ("", _("XChat: File offer from: %s (%s)"),
								word[1], network);

	return XCHAT_EAT_NONE;
}
Esempio n. 10
0
static void
tray_stop_flash (void)
{
	int nets, chans;

	if (flash_tag)
	{
		g_source_remove (flash_tag);
		flash_tag = 0;
	}

	if (sticon)
	{
		gtk_status_icon_set_from_pixbuf (sticon, ICON_NORMAL);
		nets = tray_count_networks ();
		chans = tray_count_channels ();
		if (nets)
			tray_set_tipf (_(DISPLAY_NAME": Connected to %u networks and %u channels"),
								nets, chans);
		else
			tray_set_tipf (DISPLAY_NAME": %s", _("Not connected."));
	}

	if (custom_icon1)
	{
		tray_icon_free (custom_icon1);
		custom_icon1 = NULL;
	}

	if (custom_icon2)
	{
		tray_icon_free (custom_icon2);
		custom_icon2 = NULL;
	}

	tray_status = TS_NONE;
}
Esempio n. 11
0
static int
tray_message_cb (char *word[], void *userdata)
{
	if (/*tray_status == TS_MESSAGE ||*/ tray_status == TS_HIGHLIGHT)
		return HEXCHAT_EAT_NONE;
		
	if (prefs.hex_input_tray_chans)
	{
		tray_set_flash (ICON_MSG);

		tray_pub_count++;
		if (tray_pub_count == 1)
			tray_set_tipf (_(DISPLAY_NAME": Channel message from: %s (%s)"),
								word[1], hexchat_get_info (ph, "channel"));
		else
			tray_set_tipf (_(DISPLAY_NAME": %u channel messages."), tray_pub_count);
	}

	if (prefs.hex_input_balloon_chans)
		tray_set_balloonf (word[2], _("Channel message from: %s (%s)"),
								 word[1], hexchat_get_info (ph, "channel"));

	return HEXCHAT_EAT_NONE;
}