/pidgin/main: 72893d196f1a: Remove ancient, never-used, disabled...
Michael McConville
mmcconville at mykolab.com
Tue Jul 21 14:40:07 EDT 2015
Changeset: 72893d196f1a179e269813e67a87c43568198333
Author: Michael McConville <mmcconville at mykolab.com>
Date: 2015-07-21 14:38 -0400
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/72893d196f1a
Description:
Remove ancient, never-used, disabled, and presumably broken logging features
diffstat:
libpurple/log.c | 110 -----------------------------
libpurple/plugins/log_reader.c | 151 -----------------------------------------
2 files changed, 0 insertions(+), 261 deletions(-)
diffs (truncated from 302 to 300 lines):
diff --git a/libpurple/log.c b/libpurple/log.c
--- a/libpurple/log.c
+++ b/libpurple/log.c
@@ -1284,116 +1284,6 @@ static char *process_txt_log(char *txt,
return txt;
}
-#if 0 /* Maybe some other time. */
-/****************
- ** XML LOGGER **
- ****************/
-
-static const char *str_from_msg_type (PurpleMessageFlags type)
-{
-
- return "";
-
-}
-
-static void xml_logger_write(PurpleLog *log,
- PurpleMessageFlags type,
- const char *from, time_t time, const char *message)
-{
- char *xhtml = NULL;
-
- if (!log->logger_data) {
- /* This log is new. We could use the loggers 'new' function, but
- * creating a new file there would result in empty files in the case
- * that you open a convo with someone, but don't say anything.
- */
- struct tm *tm;
- const char *tz;
- const char *date;
- char *dir = purple_log_get_log_dir(log->type, log->name, log->account);
- char *name;
- char *filename;
-
- if (dir == NULL)
- return;
-
- tm = localtime(&log->time);
- tz = purple_escape_filename(purple_utf8_strftime("%Z", tm);
- date = purple_utf8_strftime("%Y-%m-%d.%H%M%S%z", tm);
-
- name = g_strdup_printf("%s%s%s", date, tz, ext ? ext : "");
-
- purple_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
-
- filename = g_build_filename(dir, name, NULL);
- g_free(dir);
- g_free(name);
-
- log->logger_data = g_fopen(filename, "a");
- if (!log->logger_data) {
- purple_debug(PURPLE_DEBUG_ERROR, "log", "Could not create log file %s\n", filename);
- g_free(filename);
- return;
- }
- g_free(filename);
- fprintf(log->logger_data, "<?xml version='1.0' encoding='UTF-8' ?>\n"
- "<?xml-stylesheet href='file:///usr/src/web/htdocs/log-stylesheet.xsl' type='text/xml' ?>\n");
-
- date = purple_utf8_strftime("%Y-%m-%d %H:%M:%S", localtime(&log->time));
- fprintf(log->logger_data, "<conversation time='%s' screenname='%s' protocol='%s'>\n",
- date, log->name, protocol);
- }
-
- /* if we can't write to the file, give up before we hurt ourselves */
- if(!data->file)
- return;
-
- date = log_get_timestamp(log, time);
-
- purple_markup_html_to_xhtml(message, &xhtml, NULL);
- if (from)
- fprintf(log->logger_data, "<message %s %s from='%s' time='%s'>%s</message>\n",
- str_from_msg_type(type),
- type & PURPLE_MESSAGE_SEND ? "direction='sent'" :
- type & PURPLE_MESSAGE_RECV ? "direction='received'" : "",
- from, date, xhtml);
- else
- fprintf(log->logger_data, "<message %s %s time='%s'>%s</message>\n",
- str_from_msg_type(type),
- type & PURPLE_MESSAGE_SEND ? "direction='sent'" :
- type & PURPLE_MESSAGE_RECV ? "direction='received'" : "",
- date, xhtml):
- fflush(log->logger_data);
- g_free(date);
- g_free(xhtml);
-}
-
- static void xml_logger_finalize(PurpleLog *log)
-{
- if (log->logger_data) {
- fprintf(log->logger_data, "</conversation>\n");
- fclose(log->logger_data);
- log->logger_data = NULL;
- }
-}
-
-static GList *xml_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account)
-{
- return purple_log_common_lister(type, sn, account, ".xml", &xml_logger);
-}
-
-static PurpleLogLogger xml_logger = {
- N_("XML"), "xml",
- NULL,
- xml_logger_write,
- xml_logger_finalize,
- xml_logger_list,
- NULL,
- NULL,
- NULL
-};
-#endif
-
/****************************
** HTML LOGGER *************
****************************/
diff --git a/libpurple/plugins/log_reader.c b/libpurple/plugins/log_reader.c
--- a/libpurple/plugins/log_reader.c
+++ b/libpurple/plugins/log_reader.c
@@ -317,110 +317,6 @@ static void adium_logger_finalize(Purple
/*****************************************************************************
- * Fire Logger *
- *****************************************************************************/
-
-#if 0
-/* The fire logger doesn't write logs, only reads them. This is to include
- * Fire logs in the log viewer transparently.
- */
-
-static PurpleLogLogger *fire_logger;
-
-struct fire_logger_data {
-};
-
-static GList *fire_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account)
-{
- /* TODO: Do something here. */
- return NULL;
-}
-
-static char * fire_logger_read (PurpleLog *log, PurpleLogReadFlags *flags)
-{
- struct fire_logger_data *data;
-
- g_return_val_if_fail(log != NULL, g_strdup(""));
-
- data = log->logger_data;
-
- /* TODO: Do something here. */
- return g_strdup("");
-}
-
-static int fire_logger_size (PurpleLog *log)
-{
- g_return_val_if_fail(log != NULL, 0);
-
- if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes"))
- return 0;
-
- /* TODO: Do something here. */
- return 0;
-}
-
-static void fire_logger_finalize(PurpleLog *log)
-{
- g_return_if_fail(log != NULL);
-
- /* TODO: Do something here. */
-}
-#endif
-
-
-/*****************************************************************************
- * Messenger Plus! Logger *
- *****************************************************************************/
-
-#if 0
-/* The messenger_plus logger doesn't write logs, only reads them. This is to include
- * Messenger Plus! logs in the log viewer transparently.
- */
-
-static PurpleLogLogger *messenger_plus_logger;
-
-struct messenger_plus_logger_data {
-};
-
-static GList *messenger_plus_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account)
-{
- /* TODO: Do something here. */
- return NULL;
-}
-
-static char * messenger_plus_logger_read (PurpleLog *log, PurpleLogReadFlags *flags)
-{
- struct messenger_plus_logger_data *data = log->logger_data;
-
- g_return_val_if_fail(log != NULL, g_strdup(""));
-
- data = log->logger_data;
-
- /* TODO: Do something here. */
- return g_strdup("");
-}
-
-static int messenger_plus_logger_size (PurpleLog *log)
-{
- g_return_val_if_fail(log != NULL, 0);
-
- if (purple_prefs_get_bool("/plugins/core/log_reader/fast_sizes"))
- return 0;
-
- /* TODO: Do something here. */
- return 0;
-}
-
-static void messenger_plus_logger_finalize(PurpleLog *log)
-{
- g_return_if_fail(log != NULL);
-
- /* TODO: Do something here. */
-}
-#endif
-
-
-/*****************************************************************************
* MSN Messenger Logger *
*****************************************************************************/
@@ -2758,16 +2654,6 @@ get_plugin_pref_frame(PurplePlugin *plug
"/plugins/core/log_reader/adium/log_directory", _("Adium"));
purple_plugin_pref_frame_add(frame, ppref);
-#if 0
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/log_reader/fire/log_directory", _("Fire"));
- purple_plugin_pref_frame_add(frame, ppref);
-
- ppref = purple_plugin_pref_new_with_name_and_label(
- "/plugins/core/log_reader/messenger_plus/log_directory", _("Messenger Plus!"));
- purple_plugin_pref_frame_add(frame, ppref);
-#endif
-
ppref = purple_plugin_pref_new_with_name_and_label(
"/plugins/core/log_reader/qip/log_directory", _("QIP"));
purple_plugin_pref_frame_add(frame, ppref);
@@ -2836,33 +2722,6 @@ plugin_load(PurplePlugin *plugin, GError
adium_logger_size);
purple_log_logger_add(adium_logger);
-#if 0
- /* The names of IM clients are marked for translation at the request of
- translators who wanted to transliterate them. Many translators
- choose to leave them alone. Choose what's best for your language. */
- fire_logger = purple_log_logger_new("fire", _("Fire"), 6,
- NULL,
- NULL,
- fire_logger_finalize,
- fire_logger_list,
- fire_logger_read,
- fire_logger_size);
- purple_log_logger_add(fire_logger);
-
- /* The names of IM clients are marked for translation at the request of
- translators who wanted to transliterate them. Many translators
- choose to leave them alone. Choose what's best for your language. */
- messenger_plus_logger = purple_log_logger_new("messenger_plus", _("Messenger Plus!"), 6,
- NULL,
- NULL,
- messenger_plus_logger_finalize,
- messenger_plus_logger_list,
- messenger_plus_logger_read,
- messenger_plus_logger_size);
- purple_log_logger_add(messenger_plus_logger);
-
-#endif
-
/* The names of IM clients are marked for translation at the request of
translators who wanted to transliterate them. Many translators
choose to leave them alone. Choose what's best for your language. */
@@ -2923,16 +2782,6 @@ plugin_unload(PurplePlugin *plugin, GErr
purple_log_logger_free(adium_logger);
adium_logger = NULL;
-#if 0
- purple_log_logger_remove(fire_logger);
- purple_log_logger_free(fire_logger);
- fire_logger = NULL;
-
- purple_log_logger_remove(messenger_plus_logger);
- purple_log_logger_free(messenger_plus_logger);
- messenger_plus_logger = NULL;
-#endif
-
purple_log_logger_remove(msn_logger);
More information about the Commits
mailing list