Пример #1
0
static int
new_action_cb (char *word[], gpointer data)
{
	const char *channel;
	gchar *stripped, *message, *summary;

	if (focused)
		return XCHAT_EAT_NONE;

	channel = xchat_get_info (ph, "channel");
	stripped = xchat_strip (ph, word[2], -1, STRIP_COLORS | STRIP_ATTRS);

	message = g_strdup_printf ("* %s %s", word[1], stripped);
	if (channel[0] == '#')
		summary = g_strdup_printf (_("Message in %s"), channel);
	else
		summary = g_strdup_printf (_("Message from %s"), channel);

	add_notify (summary, message);

	xchat_free (ph, stripped);
	g_free (message);
	g_free (summary);
	return XCHAT_EAT_NONE;
}
Пример #2
0
// xchat.strip(str, [flags])
static int xclua_strip(lua_State * L) {
	const char * str = luaL_checkstring(L, 1);
	int flags = luaL_optint(L, 2, 3);	// 3 == xchat.STRIP_COLOR + xchat.STRIP_FORMAT
	
	char * stripped = xchat_strip(ph, str, -1, flags);
	lua_pushstring(L, stripped);
	xchat_free(ph, stripped);
	return 1;
}
Пример #3
0
static int
private_msg_cb (char *word[], gpointer data)
{
	gchar *message, *summary;

	if (focused)
		return XCHAT_EAT_NONE;

	message = xchat_strip (ph, word[2], -1, STRIP_COLORS | STRIP_ATTRS);
	summary = g_strdup_printf (_("Private Message from %s"), word[1]);

	add_notify (summary, message);

	xchat_free (ph, message);
	g_free (summary);
	return XCHAT_EAT_NONE;
}