# HG changeset patch # User Tim Ringenbach # Date 1177363506 0 # Node ID ee84a282735614b43941363a49cd7abf9198d100 # Parent 35928c2d830682c844682f0727adadb577da6766# Parent f3d9a36467356f0bc81394f00de96a82c4103e5b merge of '35928c2d830682c844682f0727adadb577da6766' and 'f3d9a36467356f0bc81394f00de96a82c4103e5b' diff -r 35928c2d8306 -r ee84a2827356 Makefile.am --- a/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -6,7 +6,6 @@ HACKING \ Makefile.mingw \ PLUGIN_HOWTO \ - PROGRAMMING_NOTES \ README.MTN \ README.mingw \ config.h.mingw \ diff -r 35928c2d8306 -r ee84a2827356 PROGRAMMING_NOTES --- a/PROGRAMMING_NOTES Mon Apr 23 02:44:04 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -Notes on keeping Pidgin, Finch, and libpurple OS independant ------------------------------------------------------------- - -General -------- -- Use G_DIR_SEPARATOR_S and G_DIR_SEPARATOR for paths - -- Use g_getenv, g_snprintf, g_vsnprintf - -- Use purple_home_dir instead of g_get_home_dir or g_getenv("HOME") - -- Make sure when including win32dep.h that it is the last header to - be included. - -- Open binary files when reading or writing with 'b' mode. - - e.g: fopen("somefile", "wb"); - - Not doing so will open files in windows using default translation mode. - i.e. newline -> - -Paths ------ - -- DATADIR, LOCALEDIR & LIBDIR are defined as functions in the win32 build - Doing the following will therefore break the windows build: - - printf("File in DATADIR is: %s\n", DATADIR G_DIR_SEPARATOR_S "pic.png"); - - it should be: - - printf("File in DATADIR is: %s%s%s\n", DATADIR, G_DIR_SEPARATOR_S, "pic.png"); - -PLUGINS & PROTOS ----------------- - -- G_MODULE_EXPORT all functions which are to be accessed from outside the - scope of its "dll" or "so". (E.G. purple_plugin_init) - -- G_MODULE_IMPORT all global variables which are located outside your - dynamic library. (E.G. connections) - - (Not doing this will cause "Memory Access Violations" in win32) diff -r 35928c2d8306 -r ee84a2827356 configure.ac --- a/configure.ac Mon Apr 23 02:44:04 2007 +0000 +++ b/configure.ac Mon Apr 23 21:25:06 2007 +0000 @@ -1,11 +1,46 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([pidgin], [2.0.0beta7devel], [devel@pidgin.im]) +AC_PREREQ([2.50]) + +# Making releases: +# purple_micro_version += 1 +# if any functions have been added: +# purple_micro_version = 0 +# purple_minor_version += 1 +# if backwards compatibility has been broken +# purple_minor_version = 0 +# purple_micro_version = 0 +# purple_major_version += 1; +# +m4_define([purple_major_version], [2]) +m4_define([purple_minor_version], [0]) +m4_define([purple_micro_version], [0]) +m4_define([purple_version_suffix], [devel]) +m4_define([purple_version], + [purple_major_version.purple_minor_version.purple_micro_version]) +m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix])) + +AC_INIT([pidgin], [purple_display_version], [devel@pidgin.im]) + AC_CANONICAL_SYSTEM AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) #AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AC_PREREQ([2.50]) +PURPLE_MAJOR_VERSION=purple_major_version +PURPLE_MINOR_VERSION=purple_minor_version +PURPLE_MICRO_VERSION=purple_micro_version +PURPLE_VERSION=[purple_display_version] +AC_SUBST(PURPLE_MAJOR_VERSION) +AC_SUBST(PURPLE_MINOR_VERSION) +AC_SUBST(PURPLE_MICRO_VERSION) +AC_SUBST(PURPLE_VERSION) + +m4_define([lt_current], [m4_eval(100 * purple_major_version + purple_minor_version)]) +m4_define([lt_age], [purple_minor_version]) +m4_define([lt_revision], [purple_micro_version]) +LT_VERSION_INFO="lt_current:lt_revision:lt_age" +AC_SUBST(LT_VERSION_INFO) + AC_DEFINE(PIDGIN_NAME, "Pidgin", [The user-visible application name]) @@ -807,7 +842,22 @@ AC_CHECK_HEADER(sys/utsname.h) AC_CHECK_FUNC(uname) -AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes) +AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], enable_fortify="$enableval", enable_fortify=yes) + +AC_ARG_ENABLE(mcheck, [AC_HELP_STRING([--enable-mcheck], [compile with mcheck (malloc debugging) support])], enable_mcheck="$enableval", enable_mcheck="$enable_debug") +if test "x$enable_mcheck" = "xyes" ; then + orig_LIBS="$LIBS" + LIBS="$LIBS -lmcheck" + AC_MSG_CHECKING(for mcheck support) + AC_TRY_COMPILE([], [ + int main() {return 0;} + ], [ + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + LIBS="$orig_LIBS" + ]) +fi if test "x$GCC" = "xyes"; then dnl We enable -Wall later. @@ -835,10 +885,12 @@ "-Waggregate-return" \ "-Wcast-align" \ "-Wdeclaration-after-statement" \ + "-Wendif-labels" \ "-Werror-implicit-function-declaration" \ "-Wextra -Wno-sign-compare -Wno-unused-parameter" \ "-Winit-self" \ "-Wmissing-declarations" \ + "-Wmissing-noreturn" \ "-Wmissing-prototypes" \ "-Wnested-externs" \ "-Wpointer-arith" \ @@ -875,7 +927,7 @@ } ], [ AC_MSG_RESULT(yes) - DEBUG_CFLAGS="$DEBUG_CFLAGS -D_FORTIFY_SOURCE=2" + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2" ], [ AC_MSG_RESULT(no) ]) @@ -1996,6 +2048,7 @@ libpurple/protocols/yahoo/Makefile libpurple/protocols/zephyr/Makefile libpurple/tests/Makefile + libpurple/version.h finch/Makefile finch/libgnt/Makefile finch/libgnt/gnt.pc diff -r 35928c2d8306 -r ee84a2827356 finch/finch.c --- a/finch/finch.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/finch.c Mon Apr 23 21:25:06 2007 +0000 @@ -202,6 +202,11 @@ {0, 0, 0, 0} }; +#ifdef PURPLE_FATAL_ASSERTS + /* Make g_return_... functions fatal. */ + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); +#endif + #ifdef ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); @@ -323,8 +328,7 @@ /* TODO: Move prefs loading into purple_prefs_init() */ purple_prefs_load(); purple_prefs_update_old(); - purple_prefs_rename("/gaim/gnt", "/finch"); - purple_prefs_rename("/purple/gnt", "/finch"); + finch_prefs_update_old(); /* load plugins we had when we quit */ purple_plugins_load_saved("/finch/plugins/loaded"); diff -r 35928c2d8306 -r ee84a2827356 finch/gntblist.c --- a/finch/gntblist.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/gntblist.c Mon Apr 23 21:25:06 2007 +0000 @@ -110,6 +110,7 @@ static const char * get_display_name(PurpleBlistNode *node); static void savedstatus_changed(PurpleSavedStatus *now, PurpleSavedStatus *old); static void blist_show(PurpleBuddyList *list); +static void update_node_display(PurpleBlistNode *buddy, FinchBlist *ggblist); static void update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist); static void account_signed_on_cb(void); @@ -187,13 +188,16 @@ if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || contact->currentsize < 1) node_remove(list, (PurpleBlistNode*)contact); - } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + } else if (!PURPLE_BLIST_NODE_IS_GROUP(node)) { PurpleGroup *group = (PurpleGroup*)node->parent; if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || group->currentsize < 1) node_remove(list, node->parent); for (node = node->child; node; node = node->next) node->ui_data = NULL; + } else { + for (node = node->child; node; node = node->next) + node_remove(list, node); } draw_tooltip(ggblist); @@ -232,13 +236,20 @@ if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || contact->currentsize < 1) node_remove(purple_get_blist(), node); - else - add_node(node, list->ui_data); + else { + if (node->ui_data == NULL) { + /* The core seems to expect the UI to add the buddies. */ + for (node = node->child; node; node = node->next) + add_node(node, list->ui_data); + } + } } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { PurpleGroup *group = (PurpleGroup*)node; if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || group->currentsize < 1) node_remove(list, node); + else + add_node(node, list->ui_data); } } @@ -1044,8 +1055,6 @@ GList *iter; if (node == NULL) return; - if (PURPLE_BLIST_NODE_IS_CHAT(node) || PURPLE_BLIST_NODE_IS_GROUP(node)) - return; if (ggblist->tagged && (iter = g_list_find(ggblist->tagged, node)) != NULL) { ggblist->tagged = g_list_delete_link(ggblist->tagged, iter); } else { @@ -1053,7 +1062,10 @@ } if (PURPLE_BLIST_NODE_IS_CONTACT(node)) node = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)node); - update_buddy_display((PurpleBuddy*)node, ggblist); + if (PURPLE_BLIST_NODE_IS_BUDDY(node)) + update_buddy_display((PurpleBuddy*)node, ggblist); + else + update_node_display(node, ggblist); } static void @@ -1065,37 +1077,61 @@ if (target == NULL) return; - /* This target resolution probably needs more clarification; for - * example, if I tag a buddy in a contact, then place on - * another buddy in the same contact, I probably intend to - * place the tagged buddy immediately after (before?) the - * target buddy -- this will simply move the tagged buddy - * within the same contact without reference to position. */ if (PURPLE_BLIST_NODE_IS_GROUP(target)) tg = (PurpleGroup*)target; - else if (PURPLE_BLIST_NODE_IS_CONTACT(target)) - tc = (PurpleContact*)target; - else /* Buddy or Chat */ + else if (PURPLE_BLIST_NODE_IS_BUDDY(target)) { tc = (PurpleContact*)target->parent; + tg = (PurpleGroup*)target->parent->parent; + } else { + if (PURPLE_BLIST_NODE_IS_CONTACT(target)) + tc = (PurpleContact*)target; + tg = (PurpleGroup*)target->parent; + } if (ggblist->tagged) { GList *list = ggblist->tagged; ggblist->tagged = NULL; - while (list) { PurpleBlistNode *node = list->data; list = g_list_delete_link(list, list); - if (tg) { - if (PURPLE_BLIST_NODE_IS_CONTACT(node)) + + if (PURPLE_BLIST_NODE_IS_GROUP(node)) { + update_node_display(node, ggblist); + /* Add the group after the current group */ + purple_blist_add_group((PurpleGroup*)node, (PurpleBlistNode*)tg); + } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { + update_buddy_display(purple_contact_get_priority_buddy((PurpleContact*)node), ggblist); + if ((PurpleBlistNode*)tg == target) { + /* The target is a group, just add the contact to the group. */ purple_blist_add_contact((PurpleContact*)node, tg, NULL); - else + } else if (tc) { + /* The target is either a buddy, or a contact. Merge with that contact. */ + purple_blist_merge_contact((PurpleContact*)node, (PurpleBlistNode*)tc); + } else { + /* The target is a chat. Add the contact to the group after this chat. */ + purple_blist_add_contact((PurpleContact*)node, NULL, target); + } + } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + update_buddy_display((PurpleBuddy*)node, ggblist); + if ((PurpleBlistNode*)tg == target) { + /* The target is a group. Add this buddy in a new contact under this group. */ purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL); - } else { - if (PURPLE_BLIST_NODE_IS_BUDDY(node)) - purple_blist_add_buddy((PurpleBuddy*)node, tc, - purple_buddy_get_group(purple_contact_get_priority_buddy(tc)), NULL); - else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) - purple_blist_merge_contact((PurpleContact*)node, target); + } else if (PURPLE_BLIST_NODE_IS_CONTACT(target)) { + /* Add to the contact. */ + purple_blist_add_buddy((PurpleBuddy*)node, tc, NULL, NULL); + } else if (PURPLE_BLIST_NODE_IS_BUDDY(target)) { + /* Add to the contact after the selected buddy. */ + purple_blist_add_buddy((PurpleBuddy*)node, NULL, NULL, target); + } else if (PURPLE_BLIST_NODE_IS_CHAT(target)) { + /* Add to the selected chat's group. */ + purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL); + } + } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { + update_node_display(node, ggblist); + if ((PurpleBlistNode*)tg == target) + purple_blist_add_chat((PurpleChat*)node, tg, NULL); + else + purple_blist_add_chat((PurpleChat*)node, NULL, target); } } } @@ -1419,6 +1455,15 @@ } static void +update_node_display(PurpleBlistNode *node, FinchBlist *ggblist) +{ + GntTextFormatFlags flag = 0; + if (ggblist->tagged && g_list_find(ggblist->tagged, node)) + flag |= GNT_TEXT_FLAG_BOLD; + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), node, flag); +} + +static void update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist) { PurpleContact *contact; @@ -1439,10 +1484,16 @@ if (purple_presence_is_idle(purple_buddy_get_presence(buddy))) { gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, bflag | GNT_TEXT_FLAG_DIM); - gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag | GNT_TEXT_FLAG_DIM); + if (buddy == purple_contact_get_priority_buddy(contact)) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag | GNT_TEXT_FLAG_DIM); + else + update_buddy_display(purple_contact_get_priority_buddy(contact), ggblist); } else { gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, bflag); - gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag); + if (buddy == purple_contact_get_priority_buddy(contact)) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag); + else + update_buddy_display(purple_contact_get_priority_buddy(contact), ggblist); } } @@ -1890,7 +1941,6 @@ break; default: return blist_node_compare_position(n1, n2); - break; } ret = blist_node_compare_text(n1, n2); return ret; diff -r 35928c2d8306 -r ee84a2827356 finch/gntprefs.c --- a/finch/gntprefs.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/gntprefs.c Mon Apr 23 21:25:06 2007 +0000 @@ -42,9 +42,19 @@ purple_prefs_add_none("/finch/conversations"); purple_prefs_add_bool("/finch/conversations/timestamps", TRUE); - purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE); /* XXX: Not functional yet */ + purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE); +} + +void finch_prefs_update_old() +{ + const char *str = NULL; + purple_prefs_rename("/gaim/gnt", "/finch"); purple_prefs_rename("/purple/gnt", "/finch"); + + if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) && + strcmp(str, "gaim") == 0) + purple_prefs_set_string("/purple/away/idle_reporting", "purple"); } typedef struct diff -r 35928c2d8306 -r ee84a2827356 finch/gntprefs.h --- a/finch/gntprefs.h Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/gntprefs.h Mon Apr 23 21:25:06 2007 +0000 @@ -40,6 +40,10 @@ */ void finch_prefs_show_all(void); +/** + * You don't need to know about this. + */ +void finch_prefs_update_old(void); /*@}*/ #endif diff -r 35928c2d8306 -r ee84a2827356 finch/libgnt/gnttree.c --- a/finch/libgnt/gnttree.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/libgnt/gnttree.c Mon Apr 23 21:25:06 2007 +0000 @@ -152,9 +152,7 @@ while(row->next) row = row->next; - if (!row->collapsed && row->child) - row = get_last_child(row->child); - return row; + return get_last_child(row); } static GntTreeRow * diff -r 35928c2d8306 -r ee84a2827356 finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/libgnt/gntwm.c Mon Apr 23 21:25:06 2007 +0000 @@ -905,6 +905,32 @@ return FALSE; } +static gboolean +toggle_clipboard(GntBindable *bindable, GList *n) +{ + static GntWidget *clip; + gchar *text; + int maxx, maxy; + if (clip) { + gnt_widget_destroy(clip); + clip = NULL; + return TRUE; + } + getmaxyx(stdscr, maxy, maxx); + text = gnt_get_clipboard_string(); + clip = gnt_hwindow_new(FALSE); + GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT); + GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER); + gnt_box_set_pad(GNT_BOX(clip), 0); + gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); + gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text)); + gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); + gnt_widget_set_position(clip, 0, 0); + gnt_widget_draw(clip); + g_free(text); + return TRUE; +} + static void gnt_wm_class_init(GntWMClass *klass) { @@ -1039,6 +1065,8 @@ "\033" GNT_KEY_CTRL_K, NULL); gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "help-for-widget", help_for_widget, "\033" "/", NULL); + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-clipboard", + toggle_clipboard, "\033" "C", NULL); gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); diff -r 35928c2d8306 -r ee84a2827356 finch/libgnt/wms/s.c --- a/finch/libgnt/wms/s.c Mon Apr 23 02:44:04 2007 +0000 +++ b/finch/libgnt/wms/s.c Mon Apr 23 21:25:06 2007 +0000 @@ -168,32 +168,6 @@ return TRUE; } -static gboolean -toggle_clipboard(GntBindable *bindable, GList *n) -{ - static GntWidget *clip; - gchar *text; - int maxx, maxy; - if (clip) { - gnt_widget_destroy(clip); - clip = NULL; - return TRUE; - } - getmaxyx(stdscr, maxy, maxx); - text = gnt_get_clipboard_string(); - clip = gnt_hwindow_new(FALSE); - GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT); - GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER); - gnt_box_set_pad(GNT_BOX(clip), 0); - gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); - gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text)); - gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" ")); - gnt_widget_set_position(clip, 0, 0); - gnt_widget_draw(clip); - g_free(text); - return TRUE; -} - static void s_class_init(SClass *klass) { @@ -208,8 +182,6 @@ gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-buddylist", toggle_buddylist, "\033" "b", NULL); - gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-clipboard", - toggle_clipboard, "\033" "C", NULL); gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); GNTDEBUG; } diff -r 35928c2d8306 -r ee84a2827356 libpurple/Makefile.am --- a/libpurple/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -8,6 +8,7 @@ purple-url-handler \ purple.pc.in \ purple-uninstalled.pc.in \ + version.h.in \ Makefile.mingw \ win32/global.mak \ win32/libc_interface.c \ @@ -75,6 +76,7 @@ upnp.c \ util.c \ value.c \ + version.c \ xmlnode.c \ whiteboard.c @@ -219,7 +221,7 @@ $(dbus_headers) libpurple_la_DEPENDENCIES = $(STATIC_LINK_LIBS) -libpurple_la_LDFLAGS = -export-dynamic +libpurple_la_LDFLAGS = -export-dynamic -version-info $(LT_VERSION_INFO) -no-undefined libpurple_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ @@ -232,7 +234,7 @@ AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ -DDATADIR=\"$(datadir)\" \ - -DLIBDIR=\"$(libdir)/purple/\" \ + -DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ $(GLIB_CFLAGS) \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/account.c --- a/libpurple/account.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/account.c Mon Apr 23 21:25:06 2007 +0000 @@ -749,6 +749,15 @@ { purple_buddy_icons_set_account_icon(ret, (guchar *)contents, len); } + else + { + /* Try to see if the icon got left behind in the old cache. */ + g_free(filename); + filename = g_build_filename(g_get_home_dir(), ".gaim", "icons", data, NULL); + if (g_file_get_contents(filename, &contents, &len, NULL)) { + purple_buddy_icons_set_account_icon(ret, (guchar*)contents, len); + } + } g_free(filename); g_free(data); diff -r 35928c2d8306 -r ee84a2827356 libpurple/blist.c --- a/libpurple/blist.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/blist.c Mon Apr 23 21:25:06 2007 +0000 @@ -2334,7 +2334,6 @@ buddy = (PurpleBuddy *)bnode; if (account == buddy->account) { PurplePresence *presence; - recompute = TRUE; presence = purple_buddy_get_presence(buddy); @@ -2354,8 +2353,14 @@ if (!g_list_find(list, presence)) list = g_list_prepend(list, presence); - if (ops && ops->remove) + if (contact->priority == buddy) + purple_contact_invalidate_priority_buddy(contact); + else + recompute = TRUE; + + if (ops && ops->remove) { ops->remove(purplebuddylist, bnode); + } } } if (recompute) { diff -r 35928c2d8306 -r ee84a2827356 libpurple/buddyicon.c --- a/libpurple/buddyicon.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/buddyicon.c Mon Apr 23 21:25:06 2007 +0000 @@ -848,6 +848,18 @@ } static void +delete_buddy_icon_settings(PurpleBlistNode *node, const char *setting_name) +{ + purple_blist_node_remove_setting(node, setting_name); + + if (!strcmp(setting_name, "buddy_icon")) + { + purple_blist_node_remove_setting(node, "avatar_hash"); + purple_blist_node_remove_setting(node, "icon_checksum"); + } +} + +static void migrate_buddy_icon(PurpleBlistNode *node, const char *setting_name, const char *dirname, const char *filename) { @@ -875,8 +887,10 @@ FILE *file; char *new_filename; - if (!read_icon_file(path, &icon_data, &icon_len)) + if (!read_icon_file(path, &icon_data, &icon_len) || + icon_data == NULL || icon_len > 0) { + delete_buddy_icon_settings(node, setting_name); g_free(path); return; } @@ -886,6 +900,7 @@ new_filename = purple_buddy_icon_data_calculate_filename(icon_data, icon_len); if (new_filename == NULL) { + delete_buddy_icon_settings(node, setting_name); return; } @@ -908,6 +923,8 @@ path, strerror(errno)); g_free(new_filename); g_free(path); + + delete_buddy_icon_settings(node, setting_name); return; } g_free(path); @@ -931,13 +948,19 @@ } else { - int checksum = purple_blist_node_get_int(node, "icon_checksum"); - if (checksum != 0) + PurpleAccount *account = purple_buddy_get_account((PurpleBuddy *)node); + const char *prpl_id = purple_account_get_protocol_id(account); + + if (!strcmp(prpl_id, "prpl-yahoo")) { - char *checksum_str = g_strdup_printf("%i", checksum); - purple_blist_node_remove_setting(node, "icon_checksum"); - purple_blist_node_set_string(node, "icon_checksum", checksum_str); - g_free(checksum_str); + int checksum = purple_blist_node_get_int(node, "icon_checksum"); + if (checksum != 0) + { + char *checksum_str = g_strdup_printf("%i", checksum); + purple_blist_node_remove_setting(node, "icon_checksum"); + purple_blist_node_set_string(node, "icon_checksum", checksum_str); + g_free(checksum_str); + } } } } @@ -945,16 +968,7 @@ else { /* If the icon is gone, drop the setting... */ - purple_blist_node_remove_setting(node, - setting_name); - - if (!strcmp(setting_name, "buddy_icon")) - { - purple_blist_node_remove_setting(node, - "avatar_hash"); - purple_blist_node_remove_setting(node, - "icon_checksum"); - } + delete_buddy_icon_settings(node, setting_name); g_free(path); } } @@ -1006,7 +1020,7 @@ } } - while (node != NULL) + while (node != NULL) { if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { @@ -1048,7 +1062,7 @@ { migrate_buddy_icon(node, "custom_buddy_icon", - dirname, filename); + dirname, filename); } else { @@ -1065,7 +1079,7 @@ } } node = purple_blist_node_next(node, TRUE); - } + } } void diff -r 35928c2d8306 -r ee84a2827356 libpurple/core.c --- a/libpurple/core.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/core.c Mon Apr 23 21:25:06 2007 +0000 @@ -116,6 +116,8 @@ purple_dbus_init(); #endif + purple_ciphers_init(); + /* Initialize all static protocols. */ static_proto_init(); @@ -134,7 +136,6 @@ purple_accounts_init(); purple_savedstatuses_init(); - purple_ciphers_init(); purple_notify_init(); purple_connections_init(); purple_conversations_init(); @@ -310,7 +311,6 @@ gboolean purple_core_migrate(void) { -#error You probably want to back up your .gaim directory right now. This revision is going to destroy it, potentially not in the way we've intended const char *user_dir = purple_user_dir(); char *old_user_dir = g_strconcat(purple_home_dir(), G_DIR_SEPARATOR_S ".gaim", NULL); diff -r 35928c2d8306 -r ee84a2827356 libpurple/example/Makefile.am --- a/libpurple/example/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/example/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -14,7 +14,7 @@ -DSTANDALONE \ -DBR_PTHREADS=0 \ -DDATADIR=\"$(datadir)\" \ - -DLIBDIR=\"$(libdir)/libpurple/\" \ + -DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -I$(top_srcdir)/libpurple/ \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/gaim-compat.h --- a/libpurple/gaim-compat.h Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/gaim-compat.h Mon Apr 23 21:25:06 2007 +0000 @@ -27,6 +27,8 @@ #ifndef _GAIM_COMPAT_H_ #define _GAIM_COMPAT_H_ +#include + /* from account.h */ #define GaimAccountUiOps PurpleAccountUiOps #define GaimAccount PurpleAccount @@ -51,7 +53,6 @@ #define gaim_account_set_password purple_account_set_password #define gaim_account_set_alias purple_account_set_alias #define gaim_account_set_user_info purple_account_set_user_info -#define gaim_account_set_buddy_icon purple_account_set_buddy_icon #define gaim_account_set_buddy_icon_path purple_account_set_buddy_icon_path #define gaim_account_set_protocol_id purple_account_set_protocol_id #define gaim_account_set_connection purple_account_set_connection @@ -81,7 +82,6 @@ #define gaim_account_get_password purple_account_get_password #define gaim_account_get_alias purple_account_get_alias #define gaim_account_get_user_info purple_account_get_user_info -#define gaim_account_get_buddy_icon purple_account_get_buddy_icon #define gaim_account_get_buddy_icon_path purple_account_get_buddy_icon_path #define gaim_account_get_protocol_id purple_account_get_protocol_id #define gaim_account_get_protocol_name purple_account_get_protocol_name @@ -338,22 +338,22 @@ #define GaimBuddyIcon PurpleBuddyIcon -#define gaim_buddy_icon_new purple_buddy_icon_new -#define gaim_buddy_icon_destroy purple_buddy_icon_destroy +#define gaim_buddy_icon_new(account, username, icon_data, icon_len)\ + purple_buddy_icon_new(account, username, g_memdup(icon_data, icon_len), icon_len) #define gaim_buddy_icon_ref purple_buddy_icon_ref #define gaim_buddy_icon_unref purple_buddy_icon_unref #define gaim_buddy_icon_update purple_buddy_icon_update -#define gaim_buddy_icon_set_account purple_buddy_icon_set_account -#define gaim_buddy_icon_set_username purple_buddy_icon_set_username -#define gaim_buddy_icon_set_data purple_buddy_icon_set_protocol_data +#define gaim_buddy_icon_set_data(icon, data, len) \ + purple_buddy_icon_set_protocol_data(icon, g_memdup(data, len), len, NULL); #define gaim_buddy_icon_get_account purple_buddy_icon_get_account #define gaim_buddy_icon_get_username purple_buddy_icon_get_username #define gaim_buddy_icon_get_data purple_buddy_icon_get_data #define gaim_buddy_icon_get_type purple_buddy_icon_get_extension -#define gaim_buddy_icons_set_for_user purple_buddy_icons_set_for_user +#define gaim_buddy_icons_set_for_user(icon, data, len) \ + purple_buddy_icons_set_for_user(icon, g_memdup(data, len), len) #define gaim_buddy_icons_find purple_buddy_icons_find #define gaim_buddy_icons_set_caching purple_buddy_icons_set_caching #define gaim_buddy_icons_is_caching purple_buddy_icons_is_caching @@ -944,7 +944,6 @@ /* from gaim-client.h */ -/* XXX: should this be purple_init, or pidgin_init */ #define gaim_init purple_init /* from idle.h */ @@ -962,7 +961,7 @@ #define GaimStoredImage PurpleStoredImage -#define gaim_imgstore_add purple_imgstore_add_with_id +#define gaim_imgstore_add(data, size, filename) purple_imgstore_add_with_id(g_memdup(data, size), size, filename) #define gaim_imgstore_get purple_imgstore_find_by_id #define gaim_imgstore_get_data purple_imgstore_get_data #define gaim_imgstore_get_size purple_imgstore_get_size diff -r 35928c2d8306 -r ee84a2827356 libpurple/imgstore.c --- a/libpurple/imgstore.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/imgstore.c Mon Apr 23 21:25:06 2007 +0000 @@ -71,13 +71,13 @@ PurpleStoredImage *img = purple_imgstore_add(data, size, filename); img->id = ++nextid; - g_hash_table_insert(imgstore, GINT_TO_POINTER(img->id), img); + g_hash_table_insert(imgstore, &(img->id), img); return img->id; } PurpleStoredImage *purple_imgstore_find_by_id(int id) { - PurpleStoredImage *img = g_hash_table_lookup(imgstore, GINT_TO_POINTER(id)); + PurpleStoredImage *img = g_hash_table_lookup(imgstore, &id); if (img != NULL) purple_debug_misc("imgstore", "retrieved image id %d\n", img->id); @@ -155,11 +155,12 @@ purple_signal_emit(purple_imgstore_get_handle(), "image-deleting", img); if (img->id) - g_hash_table_remove(imgstore, GINT_TO_POINTER(img->id)); + g_hash_table_remove(imgstore, &img->id); g_free(img->data); g_free(img->filename); g_free(img); + img = NULL; } return img; @@ -192,5 +193,5 @@ { g_hash_table_destroy(imgstore); - purple_signals_unregister_by_instance(purple_blist_get_handle()); + purple_signals_unregister_by_instance(purple_imgstore_get_handle()); } diff -r 35928c2d8306 -r ee84a2827356 libpurple/imgstore.h --- a/libpurple/imgstore.h Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/imgstore.h Mon Apr 23 21:25:06 2007 +0000 @@ -100,7 +100,7 @@ * @return The size of the data that the pointer returned by * purple_imgstore_get_data points to. */ -size_t purple_imgstore_get_size(PurpleStoredImage *i); +size_t purple_imgstore_get_size(PurpleStoredImage *img); /** * Retrieves a pointer to the image's filename. diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/Makefile.am --- a/libpurple/plugins/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -22,7 +22,7 @@ ssl \ $(TCL_DIR) -plugindir = $(libdir)/purple +plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) autoaccept_la_LDFLAGS = -module -avoid-version buddynote_la_LDFLAGS = -module -avoid-version diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/mono/Makefile.am --- a/libpurple/plugins/mono/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/mono/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -5,7 +5,7 @@ EXTRA_DIST = $(mono_sources) -monodir = $(libdir)/purple +monodir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) mono_SCRIPTS = MPlugin.dll GetBuddyBack.dll mono_build_sources = $(addprefix $(srcdir)/, $(mono_sources)) diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/mono/api/Makefile.am --- a/libpurple/plugins/mono/api/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/mono/api/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,4 +1,4 @@ -monodir=$(libdir)/purple +monodir=$(libdir)/purple-$(PURPLE_MAJOR_VERSION) mono_sources = \ BlistNode.cs \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/mono/loader/Makefile.am --- a/libpurple/plugins/mono/loader/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/mono/loader/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,4 +1,4 @@ -plugindir = $(libdir)/purple +plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) plugin_LTLIBRARIES = mono.la diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/Makefile.am --- a/libpurple/plugins/perl/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/perl/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,13 +1,11 @@ -plugindir = $(libdir)/purple -hackdir = $(plugindir)/private +plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) perl_dirs = common plugin_LTLIBRARIES = perl.la -hack_LTLIBRARIES = libpurpleperl.la perl_la_LDFLAGS = -module -avoid-version -perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS) libpurpleperl.la +perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS) perl_la_SOURCES = \ perl.c \ perl-common.c \ @@ -17,12 +15,7 @@ perl_la_DEPENDENCIES = \ .libs/libperl_orig.a \ - .libs/DynaLoader.a \ - libpurpleperl.la - -libpurpleperl_la_LDFLAGS = -module -avoid-version -libpurpleperl_la_LIBADD = $(GLIB_LIBS) -libpurpleperl_la_SOURCES = libpurpleperl.c + .libs/DynaLoader.a .libs/libperl_orig.a: @mkdir -p .libs @@ -42,55 +35,52 @@ $(LN_S) $(DYNALOADER_A) .libs/DynaLoader.a; \ fi - common_sources = \ - common/Account.xs \ - common/AccountOpts.xs \ - common/BuddyIcon.xs \ - common/BuddyList.xs \ - common/Cipher.xs \ - common/Cmds.xs \ - common/Core.xs \ - common/Connection.xs \ - common/Conversation.xs \ - common/Debug.xs \ - common/FT.xs \ - common/ImgStore.xs \ - common/Log.xs \ - common/Makefile.PL.in \ - common/Network.xs \ - common/Notify.xs \ - common/Plugin.xs \ - common/PluginPref.xs \ - common/Pounce.xs \ - common/Prefs.xs \ - common/Privacy.xs \ - common/Proxy.xs \ - common/Prpl.xs \ - common/Purple.pm \ - common/Purple.xs \ - common/Request.xs \ - common/Roomlist.xs \ - common/SSLConn.xs \ - common/SavedStatuses.xs \ - common/Server.xs \ - common/Signal.xs \ - common/Sound.xs \ - common/Status.xs \ - common/Stringref.xs \ - common/Util.xs \ - common/XMLNode.xs \ - common/fallback/const-c.inc \ - common/fallback/const-xs.inc \ - common/module.h \ - common/typemap - + common/Account.xs \ + common/AccountOpts.xs \ + common/BuddyIcon.xs \ + common/BuddyList.xs \ + common/Cipher.xs \ + common/Cmds.xs \ + common/Core.xs \ + common/Connection.xs \ + common/Conversation.xs \ + common/Debug.xs \ + common/FT.xs \ + common/ImgStore.xs \ + common/Log.xs \ + common/Makefile.PL.in \ + common/Network.xs \ + common/Notify.xs \ + common/Plugin.xs \ + common/PluginPref.xs \ + common/Pounce.xs \ + common/Prefs.xs \ + common/Privacy.xs \ + common/Proxy.xs \ + common/Prpl.xs \ + common/Purple.pm \ + common/Purple.xs \ + common/Request.xs \ + common/Roomlist.xs \ + common/SSLConn.xs \ + common/SavedStatuses.xs \ + common/Server.xs \ + common/Signal.xs \ + common/Sound.xs \ + common/Status.xs \ + common/Stringref.xs \ + common/Util.xs \ + common/XMLNode.xs \ + common/module.h \ + common/typemap \ + common/fallback/const-c.inc \ + common/fallback/const-xs.inc EXTRA_DIST = \ Makefile.mingw \ common/Makefile.mingw \ - $(common_sources) \ - libpurpleperl.c + $(common_sources) common/Makefile: common/Makefile.PL @if test "x${top_srcdir}" != "x${top_builddir}"; then \ @@ -157,7 +147,6 @@ done; \ fi - AM_CPPFLAGS = \ -DVERSION=\"$(VERSION)\" \ -I$(top_srcdir) \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/common/Makefile.PL.in --- a/libpurple/plugins/perl/common/Makefile.PL.in Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/perl/common/Makefile.PL.in Mon Apr 23 21:25:06 2007 +0000 @@ -1,18 +1,18 @@ use 5.006; use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. +# See lib/ExtUtils/MakeMaker.pm for details of how to influence the contents +# of the Makefile that is written. WriteMakefile( - 'NAME' => 'Purple', - 'VERSION_FROM' => '@srcdir@/Purple.pm', # finds $VERSION - 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 - ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT_FROM => '@srcdir@/Purple.pm', # retrieve abstract from module - AUTHOR => 'Purple ') : ()), - 'LIBS' => [''], # e.g., '-lm' - 'DEFINE' => '@DEBUG_CFLAGS@', # e.g., '-DHAVE_SOMETHING' - 'INC' => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@', # e.g., '-I. -I/usr/include/other' - 'OBJECT' => '$(O_FILES)', # link all the C files too + 'NAME' => 'Purple', + 'VERSION_FROM' => '@srcdir@/Purple.pm', # finds $VERSION + 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 + ($] >= 5.005 ? ## Add these new keywords supported since 5.005 + (ABSTRACT_FROM => '@srcdir@/Purple.pm', # finds $ABSTRACT + AUTHOR => 'Purple ') : ()), + 'DEFINE' => '@DEBUG_CFLAGS@', + 'INC' => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@', + 'OBJECT' => '$(O_FILES)', # link all the C files too +# 'OPTIMIZE' => '-g', # For debugging ); if (eval {require ExtUtils::Constant; 1}) { diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/common/Makefile.mingw --- a/libpurple/plugins/perl/common/Makefile.mingw Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/perl/common/Makefile.mingw Mon Apr 23 21:25:06 2007 +0000 @@ -66,7 +66,7 @@ Status.xs \ Stringref.xs \ Util.xs \ - XMLNode.xs \ + XMLNode.xs FALLBACKS = const-c.inc const-xs.inc C_FILES = $(XS_FILES:%.xs=%.c) diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/common/Purple.pm --- a/libpurple/plugins/perl/common/Purple.pm Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/perl/common/Purple.pm Mon Apr 23 21:25:06 2007 +0000 @@ -58,7 +58,7 @@ =head1 NAME -libpurple - Perl extension to the libpurple instant messenger library. +Purple - Perl extension to the libpurple instant messenger library. =head1 SYNOPSIS diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/perl.c --- a/libpurple/plugins/perl/perl.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/perl/perl.c Mon Apr 23 21:25:06 2007 +0000 @@ -93,6 +93,8 @@ #include "perl-common.h" #include "perl-handlers.h" +#include + #define PERL_PLUGIN_ID "core-perl" PerlInterpreter *my_perl = NULL; @@ -578,11 +580,11 @@ PURPLE_PLUGIN_MAGIC, PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION, - PURPLE_PLUGIN_LOADER, /**< type */ + PURPLE_PLUGIN_LOADER, /**< type */ NULL, /**< ui_requirement */ 0, /**< flags */ NULL, /**< dependencies */ - PURPLE_PRIORITY_DEFAULT, /**< priority */ + PURPLE_PRIORITY_DEFAULT, /**< priority */ PERL_PLUGIN_ID, /**< id */ N_("Perl Plugin Loader"), /**< name */ @@ -590,7 +592,7 @@ N_("Provides support for loading perl plugins."), /**< summary */ N_("Provides support for loading perl plugins."), /**< description */ "Christian Hammond ", /**< author */ - PURPLE_WEBSITE, /**< homepage */ + PURPLE_WEBSITE, /**< homepage */ plugin_load, /**< load */ plugin_unload, /**< unload */ @@ -608,4 +610,23 @@ loader_info.exts = g_list_append(loader_info.exts, "pl"); } +#ifdef __SUNPRO_C +#pragma init (my_init) +#else +void __attribute__ ((constructor)) my_init(void); +#endif + +void +my_init(void) +{ + /* Mostly evil hack... puts perl.so's symbols in the global table but + * does not create a circular dependency because g_module_open will + * only open the library once. */ + /* Do we need to keep track of the returned GModule here so that we + * can g_module_close it when this plugin gets unloaded? + * At the moment I don't think this plugin can ever get unloaded but + * in case that becomes possible this wants to get noted. */ + g_module_open("perl.so", 0); +} + PURPLE_INIT_PLUGIN(perl, init_plugin, info) diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/perl/scripts/function_list.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/plugins/perl/scripts/function_list.pl Mon Apr 23 21:25:06 2007 +0000 @@ -0,0 +1,69 @@ +$MODULE_NAME = "List all Purple:: (and Pidgin::) functions"; +use Purple; +# Uncomment this to print the Pidgin:: functions as well. +#use Pidgin; + +# All the information Purple gets about our nifty plugin +%PLUGIN_INFO = ( + perl_api_version => 2, + name => "Perl: $MODULE_NAME", + version => "0.1", + summary => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages", + description => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages", + author => "Etan Reisner ", + url => "http://sourceforge.net/users/deryni9/", + id => "functionlist", + + load => "plugin_load", + unload => "plugin_unload" +); + +sub plugin_init { + return %PLUGIN_INFO; +} + +sub print_array { + my $array = shift; + + my @arr = sort @$array; + foreach $mod (@arr) { + my @sub; + + foreach $key (sort keys %{$mod}) { + if ($key =~ /::$/) { + push @sub, "$mod$key"; + } else { + print "$mod$key\n"; + } + } + print_array(\@sub); + } +} + +sub plugin_load { + my $plugin = shift; + my @purplearray; + my @pidginarray; + + foreach $key (sort keys %Purple::) { + if ($key =~ /::$/) { + push @purplearray, "Purple::$key"; + } else { + print "Purple::$key\n"; + } + } + print_array(\@purplearray); + + foreach $key (sort keys %Pidgin::) { + if ($key =~ /::$/) { + push @pidginarray, "Pidgin::$key"; + } else { + print "Pidgin::$key\n"; + } + } + print_array(\@pidginarray); +} + +sub plugin_unload { + my $plugin = shift; +} diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/ssl/Makefile.am --- a/libpurple/plugins/ssl/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/ssl/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -plugindir = $(libdir)/purple +plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) ssl_la_LDFLAGS = -module -avoid-version ssl_gnutls_la_LDFLAGS = -module -avoid-version diff -r 35928c2d8306 -r ee84a2827356 libpurple/plugins/tcl/Makefile.am --- a/libpurple/plugins/tcl/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/plugins/tcl/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,4 +1,4 @@ -plugindir = $(libdir)/purple +plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) tcl_la_LDFLAGS = -module -avoid-version diff -r 35928c2d8306 -r ee84a2827356 libpurple/prefs.c --- a/libpurple/prefs.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/prefs.c Mon Apr 23 21:25:06 2007 +0000 @@ -1102,13 +1102,14 @@ static void purple_prefs_rename_node(struct purple_pref *oldpref, struct purple_pref *newpref) { - struct purple_pref *child; + struct purple_pref *child, *next; char *oldname, *newname; /* if we're a parent, rename the kids first */ - for(child = oldpref->first_child; child != NULL; child = child->sibling) + for(child = oldpref->first_child; child != NULL; child = next) { struct purple_pref *newchild; + next = child->sibling; for(newchild = newpref->first_child; newchild != NULL; newchild = newchild->sibling) { if(!strcmp(child->name, newchild->name)) @@ -1120,7 +1121,7 @@ if(newchild == NULL) { /* no rename happened, we weren't able to find the new pref */ char *tmpname = pref_full_name(child); - purple_debug_error("prefs", "Unable to find rename pref for %s", tmpname); + purple_debug_error("prefs", "Unable to find rename pref for %s\n", tmpname); g_free(tmpname); } } @@ -1327,6 +1328,8 @@ void purple_prefs_update_old() { + purple_prefs_rename("/core", "/purple"); + /* Remove some no-longer-used prefs */ purple_prefs_remove("/purple/away/auto_response/enabled"); purple_prefs_remove("/purple/away/auto_response/idle_only"); @@ -1360,7 +1363,6 @@ purple_prefs_set_int("/purple/sound/while_status", 3); } purple_prefs_remove("/purple/sound/while_away"); - purple_prefs_rename("/core", "/purple"); } void * diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/bonjour/Makefile.am --- a/libpurple/protocols/bonjour/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/bonjour/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) BONJOURSOURCES = \ bonjour.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/gg/Makefile.am --- a/libpurple/protocols/gg/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/gg/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -13,7 +13,7 @@ lib/pubdir50.c \ lib/pubdir.c -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) if USE_INTERNAL_LIBGADU INTGGSOURCES = \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/irc/Makefile.am --- a/libpurple/protocols/irc/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/irc/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,6 +1,6 @@ EXTRA_DIST = PROTOCOL Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) IRCSOURCES = irc.c parse.c cmds.c msgs.c irc.h dcc_send.c diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/jabber/Makefile.am --- a/libpurple/protocols/jabber/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/jabber/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -3,7 +3,7 @@ win32/posix.uname.c \ win32/utsname.h -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) JABBERSOURCES = auth.c \ auth.h \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/jabber/Makefile.mingw --- a/libpurple/protocols/jabber/Makefile.mingw Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/jabber/Makefile.mingw Mon Apr 23 21:25:06 2007 +0000 @@ -89,7 +89,7 @@ $(OBJECTS): $(PURPLE_CONFIG_H) -$(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS) +$(TARGET).dll $(TARGET).dll.a: $(PURPLE_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll $(XMPP_TARGET).dll: $(TARGET).dll.a $(XMPP_OBJECTS) diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/jabber/buddy.c Mon Apr 23 21:25:06 2007 +0000 @@ -955,22 +955,23 @@ gboolean photo = (strcmp(child->name, "PHOTO") == 0); data = purple_base64_decode(bintext, &size); - - jbi->vcard_imgids = g_slist_prepend(jbi->vcard_imgids, GINT_TO_POINTER(purple_imgstore_add_with_id(g_memdup(data, size), size, "logo.png"))); - g_string_append_printf(info_text, - "%s:
", - photo ? _("Photo") : _("Logo"), - GPOINTER_TO_INT(jbi->vcard_imgids->data)); + if (data) { + jbi->vcard_imgids = g_slist_prepend(jbi->vcard_imgids, GINT_TO_POINTER(purple_imgstore_add_with_id(g_memdup(data, size), size, "logo.png"))); + g_string_append_printf(info_text, + "%s:
", + photo ? _("Photo") : _("Logo"), + GPOINTER_TO_INT(jbi->vcard_imgids->data)); + + purple_cipher_digest_region("sha1", (guchar *)data, size, + sizeof(hashval), hashval, NULL); + p = hash; + for(i=0; i<20; i++, p+=2) + snprintf(p, 3, "%02x", hashval[i]); - purple_cipher_digest_region("sha1", (guchar *)data, size, - sizeof(hashval), hashval, NULL); - p = hash; - for(i=0; i<20; i++, p+=2) - snprintf(p, 3, "%02x", hashval[i]); - - purple_buddy_icons_set_for_user(js->gc->account, bare_jid, - data, size, hash); - g_free(bintext); + purple_buddy_icons_set_for_user(js->gc->account, bare_jid, + data, size, hash); + g_free(bintext); + } } } g_free(text); diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/msn/Makefile.am --- a/libpurple/protocols/msn/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/msn/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) MSNSOURCES = \ cmdproc.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/msn/slp.c Mon Apr 23 21:25:06 2007 +0000 @@ -955,7 +955,7 @@ if (obj == NULL) { - purple_buddy_icons_set_for_user(account, user->passport, NULL, 0, NULL); +/* purple_buddy_icons_set_for_user(account, user->passport, NULL, 0, NULL); */ return; } diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/msn/slpmsg.c --- a/libpurple/protocols/msn/slpmsg.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/msn/slpmsg.c Mon Apr 23 21:25:06 2007 +0000 @@ -106,9 +106,9 @@ long long size) { /* We can only have one data source at a time. */ - g_return_if_fail(slpmsg->buffer); - g_return_if_fail(slpmsg->img); - g_return_if_fail(slpmsg->fp); + g_return_if_fail(slpmsg->buffer == NULL); + g_return_if_fail(slpmsg->img == NULL); + g_return_if_fail(slpmsg->fp == NULL); if (body != NULL) slpmsg->buffer = g_memdup(body, size); @@ -122,9 +122,9 @@ msn_slpmsg_set_image(MsnSlpMessage *slpmsg, PurpleStoredImage *img) { /* We can only have one data source at a time. */ - g_return_if_fail(slpmsg->buffer); - g_return_if_fail(slpmsg->img); - g_return_if_fail(slpmsg->fp); + g_return_if_fail(slpmsg->buffer == NULL); + g_return_if_fail(slpmsg->img == NULL); + g_return_if_fail(slpmsg->fp == NULL); slpmsg->img = purple_imgstore_ref(img); slpmsg->buffer = (guchar *)purple_imgstore_get_data(img); @@ -137,9 +137,9 @@ struct stat st; /* We can only have one data source at a time. */ - g_return_if_fail(slpmsg->buffer); - g_return_if_fail(slpmsg->img); - g_return_if_fail(slpmsg->fp); + g_return_if_fail(slpmsg->buffer == NULL); + g_return_if_fail(slpmsg->img == NULL); + g_return_if_fail(slpmsg->fp == NULL); slpmsg->fp = g_fopen(file_name, "rb"); diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/novell/Makefile.am --- a/libpurple/protocols/novell/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/novell/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) NOVELLSOURCES = \ nmfield.h \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/oscar/Makefile.am --- a/libpurple/protocols/oscar/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/oscar/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -3,7 +3,7 @@ AUTHORS \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) OSCARSOURCES = \ bstream.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/oscar/family_feedbag.c --- a/libpurple/protocols/oscar/family_feedbag.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/oscar/family_feedbag.c Mon Apr 23 21:25:06 2007 +0000 @@ -112,7 +112,7 @@ */ static struct aim_ssi_item *aim_ssi_itemlist_add(struct aim_ssi_item **list, const char *name, guint16 gid, guint16 bid, guint16 type, aim_tlvlist_t *data) { - int i; + gboolean exists; struct aim_ssi_item *cur, *new; new = (struct aim_ssi_item *)malloc(sizeof(struct aim_ssi_item)); @@ -131,34 +131,37 @@ if ((new->gid == 0xFFFF) && name) { do { new->gid += 0x0001; - for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next) + exists = FALSE; + for (cur = *list; cur != NULL; cur = cur->next) if ((cur->type == AIM_SSI_TYPE_GROUP) && (cur->gid == new->gid)) { - i=1; + exists = TRUE; break; } - } while (i); + } while (exists); } } else if (new->gid == 0x0000) { if (new->bid == 0xFFFF) { do { new->bid += 0x0001; - for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next) + exists = FALSE; + for (cur = *list; cur != NULL; cur = cur->next) if (((cur->bid == new->bid) && (cur->gid == new->gid)) || (cur->gid == new->bid)) { - i=1; + exists = TRUE; break; } - } while (i); + } while (exists); } } else { if (new->bid == 0xFFFF) { do { new->bid += 0x0001; - for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next) + exists = FALSE; + for (cur = *list; cur != NULL; cur = cur->next) if ((cur->bid == new->bid) && (cur->gid == new->gid)) { - i=1; + exists = TRUE; break; } - } while (i); + } while (exists); } } diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/qq/Makefile.am --- a/libpurple/protocols/qq/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/qq/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) QQSOURCES = \ buddy_info.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/sametime/Makefile.am --- a/libpurple/protocols/sametime/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/sametime/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -2,7 +2,7 @@ EXTRA_DIST = Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) noinst_HEADERS = sametime.h diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/silc/Makefile.am --- a/libpurple/protocols/silc/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/silc/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,6 +1,6 @@ EXTRA_DIST = README TODO Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) SILCSOURCES = silc.c silcpurple.h buddy.c chat.c ft.c ops.c pk.c util.c wb.c wb.h diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/simple/Makefile.am --- a/libpurple/protocols/simple/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/simple/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) SIMPLESOURCES = \ simple.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/toc/Makefile.am --- a/libpurple/protocols/toc/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/toc/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -2,7 +2,7 @@ PROTOCOL \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) TOCSOURCES = toc.c diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/yahoo/Makefile.am --- a/libpurple/protocols/yahoo/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/yahoo/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = \ Makefile.mingw -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) YAHOOSOURCES = \ util.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Mon Apr 23 21:25:06 2007 +0000 @@ -346,6 +346,7 @@ /* FIXME: Please, if you know this protocol, * FIXME: fix up the strtol() stuff if possible. */ int cksum = strtol(pair->value, NULL, 10); + const char *locksum = NULL; PurpleBuddy *b; if (!name) @@ -364,7 +365,8 @@ break; yahoo_friend_set_buddy_icon_need_request(f, FALSE); - if (b && cksum != strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10)) + if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && + cksum != strtol(locksum, NULL, 10)) yahoo_send_picture_request(gc, name); break; diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/yahoo/yahoo_picture.c --- a/libpurple/protocols/yahoo/yahoo_picture.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Mon Apr 23 21:25:06 2007 +0000 @@ -115,9 +115,11 @@ PurpleUtilFetchUrlData *url_data; struct yahoo_fetch_picture_data *data; PurpleBuddy *b = purple_find_buddy(gc->account, who); + const char *locksum = NULL; /* FIXME: Cleanup this strtol() stuff if possible. */ - if (b && (checksum == strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10))) + if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && + (checksum == strtol(locksum, NULL, 10))) return; data = g_new0(struct yahoo_fetch_picture_data, 1); @@ -200,9 +202,11 @@ if (who) { PurpleBuddy *b = purple_find_buddy(gc->account, who); + const char *locksum = NULL; /* FIXME: Cleanup this strtol() stuff if possible. */ - if (b && (checksum != strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10))) + if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && + (checksum != strtol(locksum, NULL, 10))) yahoo_send_picture_request(gc, who); } } diff -r 35928c2d8306 -r ee84a2827356 libpurple/protocols/zephyr/Makefile.am --- a/libpurple/protocols/zephyr/Makefile.am Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/protocols/zephyr/Makefile.am Mon Apr 23 21:25:06 2007 +0000 @@ -1,4 +1,4 @@ -pkgdir = $(libdir)/purple +pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) ZEPHYRSOURCES = \ ZAsyncLocate.c \ diff -r 35928c2d8306 -r ee84a2827356 libpurple/purple.pc.in --- a/libpurple/purple.pc.in Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/purple.pc.in Mon Apr 23 21:25:06 2007 +0000 @@ -11,4 +11,3 @@ Requires: glib-2.0 Cflags: -I${includedir}/libpurple Libs: -L${libdir} -lpurple - diff -r 35928c2d8306 -r ee84a2827356 libpurple/request.h --- a/libpurple/request.h Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/request.h Mon Apr 23 21:25:06 2007 +0000 @@ -1332,7 +1332,7 @@ * @param cancel_text The text for the @c Cancel button. * @param cancel_cb The callback for the @c Cancel button. * @param account The PurpleAccount associated with this request, or NULL if none is - * @param who The username of the buddy assocaited with this request, or NULL if none is + * @param who The username of the buddy associated with this request, or NULL if none is * @param conv The PurpleConversation associated with this request, or NULL if none is * @param user_data The data to pass to the callback. * diff -r 35928c2d8306 -r ee84a2827356 libpurple/status.c --- a/libpurple/status.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/status.c Mon Apr 23 21:25:06 2007 +0000 @@ -597,8 +597,6 @@ notify_buddy_status_update(PurpleBuddy *buddy, PurplePresence *presence, PurpleStatus *old_status, PurpleStatus *new_status) { - PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); - if (purple_prefs_get_bool("/purple/logging/log_system")) { time_t current_time = time(NULL); @@ -637,9 +635,6 @@ g_free(tmp); } - - if (ops != NULL && ops->update != NULL) - ops->update(purple_get_blist(), (PurpleBlistNode*)buddy); } static void diff -r 35928c2d8306 -r ee84a2827356 libpurple/tests/check_libpurple.c --- a/libpurple/tests/check_libpurple.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/tests/check_libpurple.c Mon Apr 23 21:25:06 2007 +0000 @@ -54,7 +54,14 @@ int main(void) { int number_failed; - SRunner *sr = srunner_create (master_suite()); + SRunner *sr; + + /* Make g_return_... functions fatal, ALWAYS. + * As this is the test code, this is NOT controlled + * by PURPLE_FATAL_ASSERTS. */ + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); + + sr = srunner_create (master_suite()); srunner_add_suite(sr, cipher_suite()); srunner_add_suite(sr, jabber_jutil_suite()); diff -r 35928c2d8306 -r ee84a2827356 libpurple/util.c --- a/libpurple/util.c Mon Apr 23 02:44:04 2007 +0000 +++ b/libpurple/util.c Mon Apr 23 21:25:06 2007 +0000 @@ -2696,6 +2696,7 @@ purple_normalize(const PurpleAccount *account, const char *str) { const char *ret = NULL; + static char buf[BUF_LEN]; if (account != NULL) { @@ -2712,7 +2713,6 @@ if (ret == NULL) { - static char buf[BUF_LEN]; char *tmp; tmp = g_utf8_normalize(str, -1, G_NORMALIZE_DEFAULT); diff -r 35928c2d8306 -r ee84a2827356 libpurple/version.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/version.c Mon Apr 23 21:25:06 2007 +0000 @@ -0,0 +1,43 @@ +/* + * @file version.c Version Functions + * @ingroup core + * + * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "internal.h" + +#include "version.h" + +const guint purple_major_version = PURPLE_MAJOR_VERSION; +const guint purple_minor_version = PURPLE_MINOR_VERSION; +const guint purple_micro_version = PURPLE_MICRO_VERSION; + +const char *purple_version_check(guint required_major, guint required_minor, guint required_micro) +{ + if (required_major > PURPLE_MAJOR_VERSION) + return "libpurple version too old (major mismatch)"; + if (required_major < PURPLE_MAJOR_VERSION) + return "libpurple version too new (major mismatch)"; + if (required_minor > PURPLE_MINOR_VERSION) + return "libpurple version too old (minor mismatch)"; + if ((required_minor == PURPLE_MINOR_VERSION) && (required_micro > PURPLE_MICRO_VERSION)) + return "libpurple version too old (micro mismatch)"; + return NULL; +} diff -r 35928c2d8306 -r ee84a2827356 libpurple/version.h --- a/libpurple/version.h Mon Apr 23 02:44:04 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/** - * @file version.h Purple Versioning - * - * purple - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef _PURPLE_VERSION_H_ -#define _PURPLE_VERSION_H_ - -#define PURPLE_MAJOR_VERSION 2 -#define PURPLE_MINOR_VERSION 0 -#define PURPLE_MICRO_VERSION 0 - -#define PURPLE_VERSION_CHECK(x,y,z) ((x) == PURPLE_MAJOR_VERSION && ((y) < PURPLE_MINOR_VERSION || ((y) == PURPLE_MINOR_VERSION && (z) <= PURPLE_MICRO_VERSION))) - -#ifdef __cplusplus -extern "C" {