diff --git a/Makefile.am b/Makefile.am index 9e638c50..f7b62d73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ ACLOCAL_AMFLAGS = -Im4 -SUBDIRS = pidgin/libpurple/protocols/facebook +SUBDIRS = facebook EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index db3ed51e..f2307765 100644 --- a/configure.ac +++ b/configure.ac @@ -99,14 +99,12 @@ AS_IF( )] ) -PLUGIN_CFLAGS="-I`pwd`/$srcdir/include -I`pwd`/$srcdir/pidgin " -PLUGIN_CFLAGS="${PLUGIN_CFLAGS} -I`pwd`/$srcdir/pidgin/libpurple" -PLUGIN_CFLAGS="$PLUGIN_CFLAGS -DPURPLE_PLUGINS -include purple-compat.h" +PLUGIN_CFLAGS="-DPURPLE_PLUGINS" AC_SUBST([PLUGIN_CFLAGS]) AM_CONDITIONAL([STATIC_FACEBOOK], false) AC_SUBST([PLUGIN_LDFLAGS], [-avoid-version]) AC_SUBST([PURPLE_LIBS], ["$GLIB_LIBS $JSON_LIBS $PURPLE_LIBS $ZLIB_LIBS"]) -AC_CONFIG_FILES([Makefile pidgin/libpurple/protocols/facebook/Makefile]) +AC_CONFIG_FILES([Makefile facebook/Makefile]) AC_OUTPUT diff --git a/pidgin/libpurple/protocols/facebook/Makefile.am b/facebook/Makefile.am similarity index 89% rename from pidgin/libpurple/protocols/facebook/Makefile.am rename to facebook/Makefile.am index 87dd0825..220af31f 100644 --- a/pidgin/libpurple/protocols/facebook/Makefile.am +++ b/facebook/Makefile.am @@ -24,11 +24,11 @@ FACEBOOKSOURCES = \ thrift.h \ util.c \ util.h \ - ../../glibcompat.h \ - ../../http.c \ - ../../http.h \ - ../../purple-socket.h \ - ../../purple-socket.c + glibcompat.h \ + purple-http.c \ + purple-http.h \ + purple-socket.h \ + purple-socket.c CLEANFILES = \ marshal.c \ @@ -67,4 +67,5 @@ AM_CPPFLAGS = \ $(PURPLE_CFLAGS) \ $(ZLIB_CFLAGS) \ $(PLUGIN_CFLAGS) \ - $(DEBUG_CFLAGS) + $(DEBUG_CFLAGS) \ + -DGLIB_DISABLE_DEPRECATION_WARNINGS diff --git a/pidgin/libpurple/protocols/facebook/Makefile.mingw b/facebook/Makefile.mingw similarity index 100% rename from pidgin/libpurple/protocols/facebook/Makefile.mingw rename to facebook/Makefile.mingw diff --git a/pidgin/libpurple/protocols/facebook/api.c b/facebook/api.c similarity index 99% rename from pidgin/libpurple/protocols/facebook/api.c rename to facebook/api.c index 445714bb..920cb4db 100644 --- a/pidgin/libpurple/protocols/facebook/api.c +++ b/facebook/api.c @@ -3323,7 +3323,7 @@ fb_api_event_dup(const FbApiEvent *event, gboolean deep) return g_new0(FbApiEvent, 1); } - ret = g_memdup(event, sizeof *event); + ret = g_memdup2(event, sizeof *event); if (deep) { ret->text = g_strdup(event->text); @@ -3362,7 +3362,7 @@ fb_api_message_dup(const FbApiMessage *msg, gboolean deep) return g_new0(FbApiMessage, 1); } - ret = g_memdup(msg, sizeof *msg); + ret = g_memdup2(msg, sizeof *msg); if (deep) { ret->text = g_strdup(msg->text); @@ -3399,7 +3399,7 @@ fb_api_presence_dup(const FbApiPresence *pres) return g_new0(FbApiPresence, 1); } - return g_memdup(pres, sizeof *pres); + return g_memdup2(pres, sizeof *pres); } void @@ -3428,7 +3428,7 @@ fb_api_thread_dup(const FbApiThread *thrd, gboolean deep) return g_new0(FbApiThread, 1); } - ret = g_memdup(thrd, sizeof *thrd); + ret = g_memdup2(thrd, sizeof *thrd); if (deep) { ret->users = NULL; @@ -3475,7 +3475,7 @@ fb_api_typing_dup(const FbApiTyping *typg) return g_new0(FbApiTyping, 1); } - return g_memdup(typg, sizeof *typg); + return g_memdup2(typg, sizeof *typg); } void @@ -3502,7 +3502,7 @@ fb_api_user_dup(const FbApiUser *user, gboolean deep) return g_new0(FbApiUser, 1); } - ret = g_memdup(user, sizeof *user); + ret = g_memdup2(user, sizeof *user); if (deep) { ret->name = g_strdup(user->name); diff --git a/pidgin/libpurple/protocols/facebook/api.h b/facebook/api.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/api.h rename to facebook/api.h diff --git a/pidgin/libpurple/protocols/facebook/data.c b/facebook/data.c similarity index 99% rename from pidgin/libpurple/protocols/facebook/data.c rename to facebook/data.c index 81e32581..6ade3bf5 100644 --- a/pidgin/libpurple/protocols/facebook/data.c +++ b/facebook/data.c @@ -381,7 +381,7 @@ fb_data_set_unread(FbData *fata, FbId id, gboolean unread) return; } - key = g_memdup(&id, sizeof id); + key = g_memdup2(&id, sizeof id); g_hash_table_replace(priv->unread, key, GINT_TO_POINTER(unread)); } @@ -523,7 +523,7 @@ fb_data_image_dup_image(FbDataImage *img, gsize *size) return NULL; } - return g_memdup(priv->image, priv->size); + return g_memdup2(priv->image, priv->size); } const gchar * diff --git a/pidgin/libpurple/protocols/facebook/data.h b/facebook/data.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/data.h rename to facebook/data.h diff --git a/pidgin/libpurple/protocols/facebook/facebook.c b/facebook/facebook.c similarity index 99% rename from pidgin/libpurple/protocols/facebook/facebook.c rename to facebook/facebook.c index 9c2edd43..1f408097 100644 --- a/pidgin/libpurple/protocols/facebook/facebook.c +++ b/facebook/facebook.c @@ -19,28 +19,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "glibcompat.h" +#include "purple-compat.h" + #include "internal.h" #include "account.h" #include "accountopt.h" -#include "blistnode.h" -#include "buddy.h" #include "buddyicon.h" -#include "buddylist.h" #include "cmds.h" #include "connection.h" #include "conversation.h" -#include "conversations.h" -#include "conversationtypes.h" -#include "glibcompat.h" -#include "image.h" -#include "image-store.h" -#include "message.h" #include "notify.h" -#include "plugins.h" -#include "presence.h" -#include "protocol.h" -#include "protocols.h" #include "request.h" #include "roomlist.h" #include "server.h" @@ -951,7 +941,7 @@ fb_blist_chat_create(GSList *buddies, gpointer data) for (l = buddies; l != NULL; l = l->next) { name = purple_buddy_get_name(l->data); uid = FB_ID_FROM_STR(name); - did = g_memdup(&uid, sizeof uid); + did = g_memdup2(&uid, sizeof uid); uids = g_slist_prepend(uids, did); } diff --git a/pidgin/libpurple/protocols/facebook/facebook.h b/facebook/facebook.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/facebook.h rename to facebook/facebook.h diff --git a/facebook/glibcompat.h b/facebook/glibcompat.h new file mode 100644 index 00000000..8f7f5b66 --- /dev/null +++ b/facebook/glibcompat.h @@ -0,0 +1,79 @@ +/* pidgin + * + * Pidgin 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + */ + +#ifndef _GLIBCOMPAT_H_ +#define _GLIBCOMPAT_H_ +/* + * SECTION:glibcompat + * @section_id: libpurple-glibcompat + * @short_description: glibcompat.h + * @title: GLib version-dependent definitions + * + * This file is internal to libpurple. Do not use! + * Also, any public API should not depend on this file. + */ + +#include + +/* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and + * possibly other 32-bit windows), so instead of relying on it, + * we'll define our own. + */ +#if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64) +# include +typedef struct _stat GStatBufW32; +static inline int +purple_g_stat(const gchar *filename, GStatBufW32 *buf) +{ + return g_stat(filename, (GStatBuf*)buf); +} +# define GStatBuf GStatBufW32 +# define g_stat purple_g_stat +#endif + +/****************************************************************************** + * g_assert_* macros + *****************************************************************************/ + +#if !GLIB_CHECK_VERSION(2, 32, 0) +static inline GByteArray * g_byte_array_new_take(guint8 *data, gsize len) +{ + GByteArray *array; + + array = g_byte_array_new(); + g_byte_array_append(array, data, len); + g_free(data); + + return array; +} + +static inline void g_queue_free_full(GQueue *queue, GDestroyNotify free_func) +{ + g_queue_foreach(queue, (GFunc)free_func, NULL); + g_queue_free(queue); +} +#endif + +#if !GLIB_CHECK_VERSION(2, 30, 0) +#define G_VALUE_INIT {0, {{0}}} +#endif + +#endif /* _GLIBCOMPAT_H_ */ diff --git a/pidgin/libpurple/protocols/facebook/http.c b/facebook/http.c similarity index 100% rename from pidgin/libpurple/protocols/facebook/http.c rename to facebook/http.c diff --git a/pidgin/libpurple/protocols/facebook/http.h b/facebook/http.h similarity index 99% rename from pidgin/libpurple/protocols/facebook/http.h rename to facebook/http.h index 8419ddae..e138c31c 100644 --- a/pidgin/libpurple/protocols/facebook/http.h +++ b/facebook/http.h @@ -33,7 +33,7 @@ #include -#include +#include /** * FB_HTTP_ERROR: diff --git a/pidgin/pidgin/pixmaps/protocols/16/facebook.png b/facebook/icons/16/facebook.png similarity index 100% rename from pidgin/pidgin/pixmaps/protocols/16/facebook.png rename to facebook/icons/16/facebook.png diff --git a/pidgin/pidgin/pixmaps/protocols/22/facebook.png b/facebook/icons/22/facebook.png similarity index 100% rename from pidgin/pidgin/pixmaps/protocols/22/facebook.png rename to facebook/icons/22/facebook.png diff --git a/pidgin/pidgin/pixmaps/protocols/48/facebook.png b/facebook/icons/48/facebook.png similarity index 100% rename from pidgin/pidgin/pixmaps/protocols/48/facebook.png rename to facebook/icons/48/facebook.png diff --git a/pidgin/libpurple/protocols/facebook/id.h b/facebook/id.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/id.h rename to facebook/id.h diff --git a/include/internal.h b/facebook/internal.h similarity index 98% rename from include/internal.h rename to facebook/internal.h index 47b2b097..d82558c1 100644 --- a/include/internal.h +++ b/facebook/internal.h @@ -43,6 +43,8 @@ # include #endif +#include "connection.h" + void _purple_socket_cancel_with_connection(PurpleConnection *gc); diff --git a/pidgin/libpurple/protocols/facebook/json.c b/facebook/json.c similarity index 100% rename from pidgin/libpurple/protocols/facebook/json.c rename to facebook/json.c diff --git a/pidgin/libpurple/protocols/facebook/json.h b/facebook/json.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/json.h rename to facebook/json.h diff --git a/facebook/marshal.c b/facebook/marshal.c new file mode 100644 index 00000000..8bf56256 --- /dev/null +++ b/facebook/marshal.c @@ -0,0 +1,196 @@ +#include "marshal.h" +/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ +#include + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_schar (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + +/* VOID:INT64 (./marshaller.list:1) */ +void +fb_marshal_VOID__INT64 (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, + gint64 arg1, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__INT64 callback; + + g_return_if_fail (n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_int64 (param_values + 1), + data2); +} + +/* VOID:POINTER,BOOLEAN (./marshaller.list:4) */ +void +fb_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__POINTER_BOOLEAN) (gpointer data1, + gpointer arg1, + gboolean arg2, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__POINTER_BOOLEAN callback; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__POINTER_BOOLEAN) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_pointer (param_values + 1), + g_marshal_value_peek_boolean (param_values + 2), + data2); +} + +/* VOID:STRING,BOXED (./marshaller.list:5) */ +void +fb_marshal_VOID__STRING_BOXED (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__STRING_BOXED) (gpointer data1, + gpointer arg1, + gpointer arg2, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__STRING_BOXED callback; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_string (param_values + 1), + g_marshal_value_peek_boxed (param_values + 2), + data2); +} + +/* VOID:POINTER,POINTER (./marshaller.list:7) */ +void +fb_marshal_VOID__POINTER_POINTER (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__POINTER_POINTER) (gpointer data1, + gpointer arg1, + gpointer arg2, + gpointer data2); + GCClosure *cc = (GCClosure *) closure; + gpointer data1, data2; + GMarshalFunc_VOID__POINTER_POINTER callback; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_pointer (param_values + 1), + g_marshal_value_peek_pointer (param_values + 2), + data2); +} + diff --git a/facebook/marshal.h b/facebook/marshal.h new file mode 100644 index 00000000..5ca7ae75 --- /dev/null +++ b/facebook/marshal.h @@ -0,0 +1,57 @@ +/* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ +#ifndef __FB_MARSHAL_MARSHAL_H__ +#define __FB_MARSHAL_MARSHAL_H__ + +#include + +G_BEGIN_DECLS + +/* VOID:INT64 (./marshaller.list:1) */ +extern +void fb_marshal_VOID__INT64 (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:OBJECT (./marshaller.list:2) */ +#define fb_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT + +/* VOID:POINTER (./marshaller.list:3) */ +#define fb_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER + +/* VOID:POINTER,BOOLEAN (./marshaller.list:4) */ +extern +void fb_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:STRING,BOXED (./marshaller.list:5) */ +extern +void fb_marshal_VOID__STRING_BOXED (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +/* VOID:VOID (./marshaller.list:6) */ +#define fb_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID + +/* VOID:POINTER,POINTER (./marshaller.list:7) */ +extern +void fb_marshal_VOID__POINTER_POINTER (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + + +G_END_DECLS + +#endif /* __FB_MARSHAL_MARSHAL_H__ */ diff --git a/pidgin/libpurple/protocols/facebook/marshaller.list b/facebook/marshaller.list similarity index 100% rename from pidgin/libpurple/protocols/facebook/marshaller.list rename to facebook/marshaller.list diff --git a/pidgin/libpurple/protocols/facebook/meson.build b/facebook/meson.build similarity index 100% rename from pidgin/libpurple/protocols/facebook/meson.build rename to facebook/meson.build diff --git a/pidgin/libpurple/protocols/facebook/mqtt.c b/facebook/mqtt.c similarity index 100% rename from pidgin/libpurple/protocols/facebook/mqtt.c rename to facebook/mqtt.c diff --git a/pidgin/libpurple/protocols/facebook/mqtt.h b/facebook/mqtt.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/mqtt.h rename to facebook/mqtt.h diff --git a/include/purple-compat.h b/facebook/purple-compat.h similarity index 100% rename from include/purple-compat.h rename to facebook/purple-compat.h diff --git a/pidgin/libpurple/http.c b/facebook/purple-http.c similarity index 99% rename from pidgin/libpurple/http.c rename to facebook/purple-http.c index 75e390ab..9dfb31a0 100644 --- a/pidgin/libpurple/http.c +++ b/facebook/purple-http.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include "http.h" +#include "purple-http.h" #include "internal.h" #include "glibcompat.h" @@ -801,8 +801,8 @@ static void _purple_http_gen_headers(PurpleHttpConnection *hc) proxy = purple_proxy_get_setup(hc->gc ? purple_connection_get_account(hc->gc) : NULL); - proxy_http = (purple_proxy_info_get_proxy_type(proxy) == PURPLE_PROXY_HTTP || - purple_proxy_info_get_proxy_type(proxy) == PURPLE_PROXY_USE_ENVVAR); + proxy_http = (purple_proxy_info_get_type(proxy) == PURPLE_PROXY_HTTP || + purple_proxy_info_get_type(proxy) == PURPLE_PROXY_USE_ENVVAR); /* this is HTTP proxy, but used with tunelling with CONNECT */ if (proxy_http && url->port != 80) proxy_http = FALSE; @@ -2664,7 +2664,7 @@ void purple_http_request_set_contents(PurpleHttpRequest *request, if (length == -1) length = strlen(contents); - request->contents = g_memdup(contents, length); + request->contents = g_memdup2(contents, length); request->contents_length = length; } diff --git a/pidgin/libpurple/http.h b/facebook/purple-http.h similarity index 100% rename from pidgin/libpurple/http.h rename to facebook/purple-http.h diff --git a/pidgin/libpurple/purple-socket.c b/facebook/purple-socket.c similarity index 99% rename from pidgin/libpurple/purple-socket.c rename to facebook/purple-socket.c index 72b368b9..30155a45 100644 --- a/pidgin/libpurple/purple-socket.c +++ b/facebook/purple-socket.c @@ -236,7 +236,7 @@ purple_socket_connect(PurpleSocket *ps, PurpleSocketConnectCb cb, g_return_val_if_fail(ps != NULL, FALSE); - if (ps->gc && purple_connection_is_disconnecting(ps->gc)) { + if (ps->gc && ps->gc->account && ps->gc->account->disconnecting) { purple_debug_error("socket", "connection is being destroyed"); ps->state = PURPLE_SOCKET_STATE_ERROR; return FALSE; diff --git a/pidgin/libpurple/purple-socket.h b/facebook/purple-socket.h similarity index 100% rename from pidgin/libpurple/purple-socket.h rename to facebook/purple-socket.h diff --git a/pidgin/libpurple/protocols/facebook/thrift.c b/facebook/thrift.c similarity index 100% rename from pidgin/libpurple/protocols/facebook/thrift.c rename to facebook/thrift.c diff --git a/pidgin/libpurple/protocols/facebook/thrift.h b/facebook/thrift.h similarity index 100% rename from pidgin/libpurple/protocols/facebook/thrift.h rename to facebook/thrift.h diff --git a/pidgin/libpurple/protocols/facebook/util.c b/facebook/util.c similarity index 99% rename from pidgin/libpurple/protocols/facebook/util.c rename to facebook/util.c index 72890a5a..19802cd5 100644 --- a/pidgin/libpurple/protocols/facebook/util.c +++ b/facebook/util.c @@ -25,10 +25,7 @@ #include #include -#include "buddylist.h" -#include "conversations.h" #include "glibcompat.h" -#include "message.h" #include "request.h" #include "server.h" diff --git a/pidgin/libpurple/protocols/facebook/util.h b/facebook/util.h similarity index 99% rename from pidgin/libpurple/protocols/facebook/util.h rename to facebook/util.h index 2a1d5ebf..571eb4d1 100644 --- a/pidgin/libpurple/protocols/facebook/util.h +++ b/facebook/util.h @@ -36,10 +36,10 @@ #include #include "account.h" -#include "conversationtypes.h" #include "debug.h" #include "connection.h" #include "conversation.h" +#include "purple-compat.h" /** * FB_UTIL_DEBUG_INFO: diff --git a/include/blistnode.h b/include/blistnode.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/buddy.h b/include/buddy.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/buddylist.h b/include/buddylist.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/conversations.h b/include/conversations.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/conversationtypes.h b/include/conversationtypes.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/image-store.h b/include/image-store.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/image.h b/include/image.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/message.h b/include/message.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/plugins.h b/include/plugins.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/presence.h b/include/presence.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/protocol.h b/include/protocol.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/protocols.h b/include/protocols.h deleted file mode 100644 index e69de29b..00000000 diff --git a/pidgin/libpurple/glibcompat.h b/pidgin/libpurple/glibcompat.h deleted file mode 100644 index 03826511..00000000 --- a/pidgin/libpurple/glibcompat.h +++ /dev/null @@ -1,139 +0,0 @@ -/* pidgin - * - * Pidgin 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA - */ - -#ifndef _GLIBCOMPAT_H_ -#define _GLIBCOMPAT_H_ -/* - * SECTION:glibcompat - * @section_id: libpurple-glibcompat - * @short_description: glibcompat.h - * @title: GLib version-dependent definitions - * - * This file is internal to libpurple. Do not use! - * Also, any public API should not depend on this file. - */ - -#include - -/* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and - * possibly other 32-bit windows), so instead of relying on it, - * we'll define our own. - */ -#if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64) -# include -typedef struct _stat GStatBufW32; -static inline int -purple_g_stat(const gchar *filename, GStatBufW32 *buf) -{ - return g_stat(filename, (GStatBuf*)buf); -} -# define GStatBuf GStatBufW32 -# define g_stat purple_g_stat -#endif - - -#ifdef __clang__ - -#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS -#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _Pragma ("clang diagnostic push") \ - _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"") - -#undef G_GNUC_END_IGNORE_DEPRECATIONS -#define G_GNUC_END_IGNORE_DEPRECATIONS \ - _Pragma ("clang diagnostic pop") - -#endif /* __clang__ */ - - -#if !GLIB_CHECK_VERSION(2, 44, 0) -#define G_IO_ERROR_CONNECTION_CLOSED G_IO_ERROR_BROKEN_PIPE -#endif - -/****************************************************************************** - * g_assert_* macros - *****************************************************************************/ - -#if !GLIB_CHECK_VERSION(2, 32, 0) -static inline GByteArray * g_byte_array_new_take(guint8 *data, gsize len) -{ - GByteArray *array; - - array = g_byte_array_new(); - g_byte_array_append(array, data, len); - g_free(data); - - return array; -} - -static inline void g_queue_free_full(GQueue *queue, GDestroyNotify free_func) -{ - g_queue_foreach(queue, (GFunc)free_func, NULL); - g_queue_free(queue); -} -#endif - -#if !GLIB_CHECK_VERSION(2, 30, 0) -#define G_VALUE_INIT {0, {{0}}} -#endif - -#if !GLIB_CHECK_VERSION(2, 38, 0) -#define g_assert_true(expr) G_STMT_START { \ - if G_LIKELY (expr) ; else \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - "'" #expr "' should be TRUE"); \ - } G_STMT_END -#define g_assert_false(expr) G_STMT_START { \ - if G_LIKELY (!(expr)) ; else \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - "'" #expr "' should be FALSE"); \ - } G_STMT_END -#define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == NULL) ; else \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - "'" #expr "' should be NULL"); \ - } G_STMT_END -#define G_ADD_PRIVATE(TypeName) G_STMT_START { } G_STMT_END -#else -#define g_type_class_add_private(k,s) G_STMT_START { } G_STMT_END -#endif - -#if !GLIB_CHECK_VERSION(2, 40, 0) -#define g_assert_nonnull(expr) G_STMT_START { \ - if G_LIKELY ((expr) != NULL) ; else \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - "'" #expr "' should not be NULL"); \ - } G_STMT_END -#endif - -#if !GLIB_CHECK_VERSION(2, 46, 0) -#define g_assert_cmpmem(m1, l1, m2, l2) G_STMT_START {\ - gconstpointer __m1 = m1, __m2 = m2; \ - int __l1 = l1, __l2 = l2; \ - if (__l1 != __l2) \ - g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", __l1, "==", __l2, 'i'); \ - else if (memcmp (__m1, __m2, __l1) != 0) \ - g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - "assertion failed (" #m1 " == " #m2 ")"); \ - } G_STMT_END -#endif - -#endif /* _GLIBCOMPAT_H_ */