Ejemplo n.º 1
0
/**
 *  * Performs the actual refresh operations.
 *  */
static void
banlist_do_refresh (struct session *sess)
{
	char tbuf[256];
	if (sess->server->connected)
	{
		GtkListStore *store;

		gtk_widget_set_sensitive (sess->res->banlist_butRefresh, FALSE);

		snprintf (tbuf, sizeof tbuf, "XChat: Ban List (%s, %s)",
						sess->channel, sess->server->servername);
		mg_set_title (sess->res->banlist_window, tbuf);

		store = get_store (sess);
		gtk_list_store_clear (store);

		handle_command (sess, "ban", FALSE);
#ifdef WIN32
		if (0)
#else
		if (supports_exempt (sess->server))
#endif
		{
			snprintf (tbuf, sizeof (tbuf), "quote mode %s +e", sess->channel);
			handle_command (sess, tbuf, FALSE);
		}

	} else
	{
		fe_message (_("Not connected."), FE_MSG_ERROR);
	}
}
Ejemplo n.º 2
0
/**
 *  * Performs the actual refresh operations.
 *  */
static void
banlist_do_refresh (banlist_info *banl)
{
	session *sess = banl->sess;
	char tbuf[256];
	int i;
	char *tbufp;

	banlist_sensitize (banl);

	if (sess->server->connected)
	{
		GtkListStore *store;

		g_snprintf (tbuf, sizeof tbuf, DISPLAY_NAME": Ban List (%s, %s)",
						sess->channel, sess->server->servername);
		mg_set_title (banl->window, tbuf);

		store = get_store (sess);
		gtk_list_store_clear (store);
		banl->line_ct = 0;
		banl->pending = banl->checked;
		if (banl->pending)
		{
			tbufp = tbuf + g_snprintf (tbuf, sizeof tbuf, "quote mode %s +", sess->channel);
			for (i = 0; i < MODE_CT; i++)
				if (banl->pending & 1<<i)
				{
					*tbufp++ = modes[i].letter;
				}
			*tbufp = 0;
			handle_command (sess, tbuf, FALSE);
		}
	}
	else
	{
		fe_message (_("Not connected."), FE_MSG_ERROR);
	}
}