im.pidgin.pidgin.2.2.2: 2126d3989cbd1af16969cb467343817a7ec9c3d2
lschiere at pidgin.im
lschiere at pidgin.im
Fri Oct 19 17:10:47 EDT 2007
-----------------------------------------------------------------
Revision: 2126d3989cbd1af16969cb467343817a7ec9c3d2
Ancestor: 35a4fd714054b2f59f2f26156711b7a1a23006ec
Author: lschiere at pidgin.im
Date: 2007-10-19T18:14:53
Branch: im.pidgin.pidgin.2.2.2
Modified files:
libpurple/plugins/log_reader.c
libpurple/plugins/ssl/ssl-nss.c
libpurple/protocols/bonjour/bonjour.c
libpurple/protocols/bonjour/parser.c
libpurple/protocols/jabber/roster.c
libpurple/tests/test_cipher.c pidgin/gtkblist.c
pidgin/gtkconv.c pidgin/gtkutils.c pidgin/win32/winpidgin.c
ChangeLog:
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
through 3efb5d625e5a73423be8be77a6baeed0b65f7e55
applied changes from 74f0e6698f9f17bc8335cf2454c06e6b13748039
through 017296ee954fb91349806c809983c916842603da
applied changes from c8ff393c43d8a5f4136c653853a95284cc5710dc
through f53dbbff44537aa86b1cb8788fd306c90e6ccca9
applied changes from f53dbbff44537aa86b1cb8788fd306c90e6ccca9
through 5798594431164383deacd7d4aad5a9a0d5b867ae
applied changes from 5798594431164383deacd7d4aad5a9a0d5b867ae
through 0822c640f22b63d7bc8992e62b80bccd1eea12a2
applied changes from 703c3f9437d5e71255819c747f9690d19c6ba6e3
through b7a2c4d81867c3bbd262c2a4b1d924ea7fd3afb6
applied changes from b7a2c4d81867c3bbd262c2a4b1d924ea7fd3afb6
through 5ea15b000ee727088be88bb335c2ded6b2ab96e3
applied changes from 5ea15b000ee727088be88bb335c2ded6b2ab96e3
through c5051010dd50f9fdb7f85d779d882ce8bbc149f2
-------------- next part --------------
============================================================
--- libpurple/plugins/log_reader.c bb60965d92b317d2cb41e929c14b1da60b21b08e
+++ libpurple/plugins/log_reader.c 898ea335396fa8bb09acb418528cbff1499627cc
@@ -232,7 +232,6 @@ static char *adium_logger_read (PurpleLo
struct adium_logger_data *data;
GError *error = NULL;
gchar *read = NULL;
- gsize length;
/* XXX: TODO: We probably want to set PURPLE_LOG_READ_NO_NEWLINE
* XXX: TODO: for HTML logs. */
@@ -246,8 +245,9 @@ static char *adium_logger_read (PurpleLo
g_return_val_if_fail(data->path != NULL, g_strdup(""));
purple_debug_info("Adium log read", "Reading %s\n", data->path);
- if (!g_file_get_contents(data->path, &read, &length, &error)) {
- purple_debug_error("Adium log read", "Error reading log\n");
+ if (!g_file_get_contents(data->path, &read, NULL, &error)) {
+ purple_debug_error("Adium log read", "Error reading log: %s\n",
+ (error && error->message) ? error->message : "Unknown error");
if (error)
g_error_free(error);
return g_strdup("");
@@ -1808,8 +1808,10 @@ static GList *qip_logger_list(PurpleLogT
error = NULL;
if (!g_file_get_contents(path, &contents, NULL, &error)) {
purple_debug_error("QIP logger",
- "Couldn't read file %s: %s \n", path, error->message);
- g_error_free(error);
+ "Couldn't read file %s: %s \n", path,
+ (error && error->message) ? error->message : "Unknown error");
+ if (error)
+ g_error_free(error);
g_free(path);
return list;
}
@@ -1955,8 +1957,10 @@ static char *qip_logger_read(PurpleLog *
error = NULL;
if (!(utf8_string = g_convert(contents, -1, "UTF-8", "Cp1251", NULL, NULL, &error))) {
purple_debug_error("QIP logger",
- "Couldn't convert file %s to UTF-8: %s\n", data->path, error->message);
- g_error_free(error);
+ "Couldn't convert file %s to UTF-8: %s\n", data->path,
+ (error && error->message) ? error->message : "Unknown error");
+ if (error)
+ g_error_free(error);
g_free(contents);
return g_strdup("");
}
@@ -2151,18 +2155,18 @@ init_plugin(PurplePlugin *plugin)
/* Calculate default Messenger Plus! log directory. */
#ifdef _WIN32
+ path = NULL;
folder = wpurple_get_special_folder(CSIDL_PERSONAL);
if (folder) {
path = g_build_filename(folder, "My Chat Logs", NULL);
g_free(folder);
- } else
- path = g_strdup("");
+ }
#else
path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
"Documents and Settings", g_get_user_name(),
"My Documents", "My Chat Logs", NULL);
#endif
- purple_prefs_add_string("/plugins/core/log_reader/messenger_plus/log_directory", path);
+ purple_prefs_add_string("/plugins/core/log_reader/messenger_plus/log_directory", path ? path : "");
g_free(path);
@@ -2171,18 +2175,18 @@ init_plugin(PurplePlugin *plugin)
/* Calculate default MSN message history directory. */
#ifdef _WIN32
+ path = NULL;
folder = wpurple_get_special_folder(CSIDL_PERSONAL);
if (folder) {
path = g_build_filename(folder, "My Received Files", NULL);
g_free(folder);
- } else
- path = g_strdup("");
+ }
#else
path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
"Documents and Settings", g_get_user_name(),
"My Documents", "My Received Files", NULL);
#endif
- purple_prefs_add_string("/plugins/core/log_reader/msn/log_directory", path);
+ purple_prefs_add_string("/plugins/core/log_reader/msn/log_directory", path ? path : "");
g_free(path);
@@ -2261,22 +2265,22 @@ init_plugin(PurplePlugin *plugin)
g_key_file_free(key_file);
}
#else /* !GLIB_CHECK_VERSION(2,6,0) */
- gsize length;
gchar *contents = NULL;
purple_debug_info("Trillian talk.ini read",
- "Reading %s\n", path);
- if (!g_file_get_contents(path, &contents, &length, &error)) {
+ "Reading %s\n", path);
+ if (!g_file_get_contents(path, &contents, NULL, &error)) {
purple_debug_error("Trillian talk.ini read",
- "Error reading talk.ini\n");
+ "Error reading talk.ini: %s\n",
+ (error && error->message) ? error->message : "Unknown error");
if (error)
g_error_free(error);
- g_free(path);
} else {
- char *line = contents;
- while (*contents) {
- if (*contents == '\n') {
- *contents = '\0';
+ char *cursor, *line;
+ line = cursor = contents;
+ while (*cursor) {
+ if (*cursor == '\n') {
+ *cursor = '\0';
/* XXX: This assumes the first Directory key is under [Logging]. */
if (purple_str_has_prefix(line, "Directory=")) {
@@ -2288,25 +2292,29 @@ init_plugin(PurplePlugin *plugin)
found = TRUE;
}
- contents++;
- line = contents;
+ cursor++;
+ line = cursor;
} else
- contents++;
+ cursor++;
}
- g_free(path);
g_free(contents);
}
+ g_free(path);
#endif /* !GTK_CHECK_VERSION(2,6,0) */
} /* path */
if (!found) {
+ path = NULL;
folder = wpurple_get_special_folder(CSIDL_PROGRAM_FILES);
if (folder) {
path = g_build_filename(folder, "Trillian", "users",
"default", "logs", NULL);
g_free(folder);
- } else
- path = g_strdup("");
+ }
+
+ purple_prefs_add_string(
+ "/plugins/core/log_reader/trillian/log_directory", path ? path : "");
+ g_free(path);
}
#else /* !defined(_WIN32) */
/* TODO: At some point, this could attempt to parse talk.ini
@@ -2317,28 +2325,27 @@ init_plugin(PurplePlugin *plugin)
path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
"Program Files", "Trillian", "users",
"default", "logs", NULL);
-#endif
-
- /*XXX: Why do we even bother allocating it ? */
+ purple_prefs_add_string(
+ "/plugins/core/log_reader/trillian/log_directory", path);
g_free(path);
+#endif
-
/* Add QIP log directory preference. */
purple_prefs_add_none("/plugins/core/log_reader/qip");
/* Calculate default QIP log directory. */
#ifdef _WIN32
+ path = NULL;
folder = wpurple_get_special_folder(CSIDL_PROGRAM_FILES);
if (folder) {
path = g_build_filename(folder, "QIP", "Users", NULL);
g_free(folder);
- } else
- path = g_strdup("");
+ }
#else
path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
"Program Files", "QIP", "Users", NULL);
#endif
- purple_prefs_add_string("/plugins/core/log_reader/qip/log_directory", path);
+ purple_prefs_add_string("/plugins/core/log_reader/qip/log_directory", path ? path : "");
g_free(path);
}
============================================================
--- libpurple/plugins/ssl/ssl-nss.c 8f2ac7cf0a8ebce37f710d7aa36c4f6a712ecbff
+++ libpurple/plugins/ssl/ssl-nss.c 3ae0c5446991c81bafe075c62230ac3849a8d532
@@ -386,6 +386,7 @@ ssl_nss_peer_certs(PurpleSslConnection *
static GList *
ssl_nss_peer_certs(PurpleSslConnection *gsc)
{
+#if 0
PurpleSslNssData *nss_data = PURPLE_SSL_NSS_DATA(gsc);
CERTCertificate *cert;
/*
@@ -397,6 +398,10 @@ ssl_nss_peer_certs(PurpleSslConnection *
/* TODO: this is a blind guess */
cert = SSL_PeerCertificate(nss_data->fd);
+ if (cert)
+ CERT_DestroyCertificate(cert);
+#endif
+
return NULL;
@@ -430,11 +435,12 @@ x509_import_from_file(const gchar *filen
filename);
/* Load the raw data up */
- g_return_val_if_fail(
- g_file_get_contents(filename,
- &rawcert, &len,
- NULL ),
- NULL);
+ if (!g_file_get_contents(filename,
+ &rawcert, &len,
+ NULL)) {
+ purple_debug_error("nss/x509", "Unable to read certificate file.\n");
+ return NULL;
+ }
/* Decode the certificate */
crt_dat = CERT_DecodeCertFromPackage(rawcert, len);
============================================================
--- libpurple/protocols/bonjour/bonjour.c 64780fa8de009d3f0535aae3bc3d10505be400da
+++ libpurple/protocols/bonjour/bonjour.c 35660039ccb51a82ef794cd00cbf4464ce229dce
@@ -188,6 +188,8 @@ bonjour_close(PurpleConnection *connecti
if (bonjour_group != NULL)
purple_blist_remove_group(bonjour_group);
+ g_free(bd);
+ connection->proto_data = NULL;
}
static const char *
@@ -581,7 +583,7 @@ static gpointer _win32_name_lookup_threa
fullname = g_utf16_to_utf8(username, -1, NULL, NULL, NULL);
}
- g_idle_add(_set_default_name_cb, fullname);
+ purple_timeout_add(0, _set_default_name_cb, fullname);
return NULL;
}
============================================================
--- libpurple/protocols/bonjour/parser.c d1a8b9e6cd20ffc135a638d6a6dd9425dde7261e
+++ libpurple/protocols/bonjour/parser.c d5decc6fae95d542db0e4f7c7d9c5d50240881e4
@@ -101,7 +101,7 @@ bonjour_parser_element_end_libxml(void *
if(!xmlStrcmp(element_name, (xmlChar*) "stream")) {
/* Asynchronously close the conversation to prevent bonjour_parser_setup()
* being called from within this context */
- g_idle_add(_async_bonjour_jabber_stream_ended_cb, pb);
+ purple_timeout_add(0, _async_bonjour_jabber_stream_ended_cb, pb);
}
return;
}
============================================================
--- libpurple/protocols/jabber/roster.c 04ce5d39a1366a2d6ce250ea42e9b74647324748
+++ libpurple/protocols/jabber/roster.c deb365dab00fc7f261eda9ac73b9309c1af0b8a6
@@ -67,8 +67,10 @@ static void add_purple_buddies_to_groups
if(!groups) {
if(!buddies)
g2 = g_slist_append(g2, g_strdup(_("Buddies")));
- else
+ else {
+ g_slist_free(buddies);
return;
+ }
}
my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
@@ -229,6 +231,11 @@ void jabber_roster_parse(JabberStream *j
remove_purple_buddies(js, jid);
} else {
GSList *groups = NULL;
+
+ if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER)
+ if (!jabber_google_roster_incoming(js, item))
+ continue;
+
for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) {
char *group_name;
@@ -237,10 +244,9 @@ void jabber_roster_parse(JabberStream *j
if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp) == NULL)
groups = g_slist_append(groups, group_name);
+ else
+ g_free(group_name);
}
- if (js->server_caps & JABBER_CAP_GOOGLE_ROSTER)
- if (!jabber_google_roster_incoming(js, item))
- continue;
add_purple_buddies_to_groups(js, jid, name, groups);
}
}
@@ -263,6 +269,9 @@ static void jabber_roster_update(JabberS
JabberIq *iq;
xmlnode *query, *item, *group;
+ if(!(b = purple_find_buddy(js->gc->account, name)))
+ return;
+
if(grps) {
groups = grps;
} else {
@@ -277,9 +286,6 @@ static void jabber_roster_update(JabberS
}
}
- if(!(b = purple_find_buddy(js->gc->account, name)))
- return;
-
iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:roster");
query = xmlnode_get_child(iq->node, "query");
============================================================
--- libpurple/tests/test_cipher.c 0a3d78d2fddd57887934cc6c76e0a11c6179beca
+++ libpurple/tests/test_cipher.c b5796e5699d8d7a6c2320513435b00fd15d04782
@@ -8,7 +8,6 @@
#include "tests.h"
#include "../cipher.h"
-#include "../signal.h"
/******************************************************************************
* MD4 Tests
============================================================
--- pidgin/gtkblist.c 411755136079086c53a23c78898366f3d3070ae6
+++ pidgin/gtkblist.c 1a17e62a64935dca9768f531e07c4418aafaac8d
@@ -5081,7 +5081,7 @@ static void buddy_node(PurpleBuddy *budd
BUDDY_ICON_COLUMN, avatar,
BUDDY_ICON_VISIBLE_COLUMN, biglist,
EMBLEM_COLUMN, emblem,
- EMBLEM_VISIBLE_COLUMN, emblem,
+ EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL),
PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
BGCOLOR_COLUMN, NULL,
@@ -5092,6 +5092,8 @@ static void buddy_node(PurpleBuddy *budd
g_free(mark);
g_free(idle);
+ if(emblem)
+ g_object_unref(emblem);
if(status)
g_object_unref(status);
if(avatar)
@@ -5260,6 +5262,8 @@ static void pidgin_blist_update_chat(Pur
-1);
g_free(mark);
+ if(emblem)
+ g_object_unref(emblem);
if(status)
g_object_unref(status);
if(avatar)
============================================================
--- pidgin/gtkconv.c 693dbd72e36e3d7e078ed63269d553729e5374ad
+++ pidgin/gtkconv.c 0beab509d425c4fb93f3ce96826bcb0038de54db
@@ -2439,11 +2439,16 @@ update_tab_icon(PurpleConversation *conv
gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model),
&(gtkconv->infopane_iter),
CONV_EMBLEM_COLUMN, emblem, -1);
+ if (emblem)
+ g_object_unref(emblem);
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) {
+ emblem = pidgin_create_prpl_icon(gtkconv->active_conv->account, PIDGIN_PRPL_ICON_SMALL);
gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model),
&(gtkconv->infopane_iter),
- CONV_PROTOCOL_ICON_COLUMN, pidgin_create_prpl_icon(gtkconv->active_conv->account, PIDGIN_PRPL_ICON_SMALL), -1);
+ CONV_PROTOCOL_ICON_COLUMN, emblem, -1);
+ if (emblem)
+ g_object_unref(emblem);
}
/* XXX seanegan Why do I have to do this? */
@@ -4665,7 +4670,6 @@ setup_common_pane(PidginConversation *gt
g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
#endif
-
rend = gtk_cell_renderer_pixbuf_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(gtkconv->infopane), rend, FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(gtkconv->infopane), rend, "pixbuf", CONV_PROTOCOL_ICON_COLUMN, NULL);
============================================================
--- pidgin/gtkutils.c 54262f3bbd7b4bd91058bbe6cde4cca6e97156c8
+++ pidgin/gtkutils.c 0352253dbb8ef3e8a0276b60465b7d224b406976
@@ -111,19 +111,20 @@ pidgin_setup_imhtml(GtkWidget *imhtml)
desc = pango_font_description_from_string(font);
} else if (purple_running_gnome()) {
/* Use the GNOME "document" font, if applicable */
- char *path, *font;
+ char *path;
if ((path = g_find_program_in_path("gconftool-2"))) {
+ char *font = NULL;
g_free(path);
- if (!g_spawn_command_line_sync(
+ if (g_spawn_command_line_sync(
"gconftool-2 -g /desktop/gnome/interface/document_font_name",
- &font, NULL, NULL, NULL))
- return;
+ &font, NULL, NULL, NULL)) {
+ desc = pango_font_description_from_string(font);
+ }
+ g_free(font);
}
- desc = pango_font_description_from_string(font);
- g_free(font);
}
-
+
if (desc) {
gtk_widget_modify_font(imhtml, desc);
pango_font_description_free(desc);
============================================================
--- pidgin/win32/winpidgin.c 765a1ff97393375b3e0b894b66c080adc7e0ba09
+++ pidgin/win32/winpidgin.c ce5243016c574a3fffc3417f85c448aabf04c740
@@ -545,7 +545,7 @@ WinMain (struct HINSTANCE__ *hInstance,
if (strstr(lpszCmdLine, "-d") || strstr(lpszCmdLine, "-h") || strstr(lpszCmdLine, "-v")) {
/* If stdout hasn't been redirected to a file, alloc a console
* (_istty() doesn't work for stuff using the GUI subsystem) */
- if (_fileno(stdout) == -1) {
+ if (_fileno(stdout) == -1 || _fileno(stdout) == -2) {
LPFNATTACHCONSOLE MyAttachConsole = NULL;
if ((hmod = GetModuleHandle("kernel32.dll"))) {
MyAttachConsole =
More information about the Commits
mailing list