コード例 #1
0
ファイル: gntnotify.c プロジェクト: Draghtnod/pidgin
static void *
finch_notify_message(PurpleNotifyMsgType type, const char *title,
	const char *primary, const char *secondary)
{
	return finch_notify_common(PURPLE_NOTIFY_MESSAGE, type, title, primary,
		secondary);
}
コード例 #2
0
ファイル: gntnotify.c プロジェクト: N8Fear/purple-facebook
static void *
finch_notify_message(PurpleNotifyMessageType type, const char *title,
	const char *primary, const char *secondary,
	PurpleRequestCommonParameters *cpar)
{
	return finch_notify_common(PURPLE_NOTIFY_MESSAGE, type, title, primary,
		secondary, cpar);
}
コード例 #3
0
ファイル: gntnotify.c プロジェクト: Draghtnod/pidgin
static void *
finch_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed,
		const char **subjects, const char **froms, const char **tos,
		const char **urls)
{
	PurpleAccount *account = purple_connection_get_account(gc);
	GString *message = g_string_new(NULL);
	void *ret;
	static int key = 0;

	if (count == 0)
		return NULL;

	if (!detailed)
	{
		g_string_append_printf(message,
				ngettext("%s (%s) has %d new message.",
					     "%s (%s) has %d new messages.",
						 (int)count),
				tos ? *tos : purple_account_get_username(account),
				purple_account_get_protocol_name(account), (int)count);
	}
	else
	{
		char *to;
		gboolean newwin = (emaildialog.window == NULL);

		if (newwin)
			setup_email_dialog();

		to = g_strdup_printf("%s (%s)", tos ? *tos : purple_account_get_username(account),
					purple_account_get_protocol_name(account));
		gnt_tree_add_row_after(GNT_TREE(emaildialog.tree), GINT_TO_POINTER(++key),
				gnt_tree_create_row(GNT_TREE(emaildialog.tree), to,
					froms ? *froms : "[Unknown sender]",
					*subjects),
				NULL, NULL);
		g_free(to);
		if (newwin)
			gnt_widget_show(emaildialog.window);
		else
			gnt_window_present(emaildialog.window);
		return NULL;
	}

	ret = finch_notify_common(PURPLE_NOTIFY_EMAIL, PURPLE_NOTIFY_MSG_INFO,
		_("New Mail"), _("You have mail!"), message->str);
	g_string_free(message, TRUE);
	return ret;
}
コード例 #4
0
ファイル: gntnotify.c プロジェクト: Draghtnod/pidgin
static void *finch_notify_formatted(const char *title, const char *primary,
		const char *secondary, const char *text)
{
	char *xhtml = NULL;
	char *t = g_strdup_printf("<span>%s%s%s</span>",
			secondary ? secondary : "",
			secondary ? "\n" : "",
			text ? text : "");
	void *ret;

	purple_markup_html_to_xhtml(t, &xhtml, NULL);
	ret = finch_notify_common(PURPLE_NOTIFY_FORMATTED,
		PURPLE_NOTIFY_MSG_INFO, title, primary, xhtml);

	g_free(t);
	g_free(xhtml);

	return ret;
}
コード例 #5
0
ファイル: gntnotify.c プロジェクト: Draghtnod/pidgin
static void *
finch_notify_uri(const char *url)
{
	return finch_notify_common(PURPLE_NOTIFY_URI, PURPLE_NOTIFY_MSG_INFO,
		_("URI"), url, NULL);
}