diff options
Diffstat (limited to 'libpurple/protocols/gg')
-rw-r--r-- | libpurple/protocols/gg/Makefile.am | 2 | ||||
-rw-r--r-- | libpurple/protocols/gg/gg.c | 33 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/common.c | 2 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/events.c | 2 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/libgadu-internal.h | 1 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/libgadu.c | 5 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/libgadu.h | 4 | ||||
-rw-r--r-- | libpurple/protocols/gg/lib/resolver.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/gg/search.c | 2 |
9 files changed, 29 insertions, 26 deletions
diff --git a/libpurple/protocols/gg/Makefile.am b/libpurple/protocols/gg/Makefile.am index 7bc99c9563..5fe288fb3d 100644 --- a/libpurple/protocols/gg/Makefile.am +++ b/libpurple/protocols/gg/Makefile.am @@ -9,6 +9,7 @@ EXTRA_DIST = \ lib/http.c \ lib/libgadu.c \ lib/libgadu-config.h \ + lib/libgadu-internal.h \ lib/libgadu.h \ lib/obsolete.c \ lib/protocol.h \ @@ -30,6 +31,7 @@ INTGGSOURCES = \ lib/http.c \ lib/libgadu.c \ lib/libgadu-config.h \ + lib/libgadu-internal.h \ lib/libgadu.h \ lib/obsolete.c \ lib/protocol.h \ diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c index 2ec6a8983d..9e36aa4c5a 100644 --- a/libpurple/protocols/gg/gg.c +++ b/libpurple/protocols/gg/gg.c @@ -1000,7 +1000,6 @@ static void ggp_generic_status_handler(PurpleConnection *gc, uin_t uin, int status, const char *descr) { gchar *from; - gchar *msg; const char *st; gchar *avatarurl; PurpleUtilFetchUrlData *url_data; @@ -1035,6 +1034,7 @@ static void ggp_generic_status_handler(PurpleConnection *gc, uin_t uin, case GG_STATUS_DND: case GG_STATUS_DND_DESCR: st = purple_primitive_get_id_from_type(PURPLE_STATUS_UNAVAILABLE); + break; case GG_STATUS_BLOCKED: /* user is blocking us.... */ st = "blocked"; @@ -1048,11 +1048,14 @@ static void ggp_generic_status_handler(PurpleConnection *gc, uin_t uin, purple_debug_info("gg", "st = %s\n", st); //msg = charset_convert(descr, "CP1250", "UTF-8"); - msg = g_strdup_printf("%s", descr); - purple_prpl_got_user_status(purple_connection_get_account(gc), - from, st, "message", msg, NULL); + if (descr == NULL) { + purple_prpl_got_user_status(purple_connection_get_account(gc), + from, st, NULL); + } else { + purple_prpl_got_user_status(purple_connection_get_account(gc), + from, st, "message", descr, NULL); + } g_free(from); - g_free(msg); } static void ggp_sr_close_cb(gpointer user_data) @@ -1598,22 +1601,16 @@ static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) } break; case GG_EVENT_NOTIFY60: - purple_debug_info("gg", - "notify60_pre: (%d) status=%d; version=%d; descr=%s\n", - ev->event.notify60->uin, GG_S(ev->event.notify60->status), - ev->event.notify60->version, - ev->event.notify60->descr ? ev->event.notify60->descr : "(null)"); - for (i = 0; ev->event.notify60[i].uin; i++) { purple_debug_info("gg", "notify60: (%d) status=%d; version=%d; descr=%s\n", ev->event.notify60[i].uin, - ev->event.notify60[i].status, + GG_S(ev->event.notify60[i].status), ev->event.notify60[i].version, ev->event.notify60[i].descr ? ev->event.notify60[i].descr : "(null)"); ggp_generic_status_handler(gc, ev->event.notify60[i].uin, - ev->event.notify60[i].status, + GG_S(ev->event.notify60[i].status), ev->event.notify60[i].descr); } break; @@ -1623,7 +1620,7 @@ static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) ev->event.status.descr ? ev->event.status.descr : "(null)"); ggp_generic_status_handler(gc, ev->event.status.uin, - ev->event.status.status, ev->event.status.descr); + GG_S(ev->event.status.status), ev->event.status.descr); break; case GG_EVENT_STATUS60: purple_debug_info("gg", @@ -1734,7 +1731,7 @@ static void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition ggp_callback_recv, gc); ggp_buddylist_send(gc); - purple_connection_update_progress(gc, _("Connected"), 2, 2); + purple_connection_update_progress(gc, _("Connected"), 1, 2); purple_connection_set_state(gc, PURPLE_CONNECTED); } break; @@ -1987,7 +1984,7 @@ static void ggp_login(PurpleAccount *account) purple_debug_info("gg", "Trying to retrieve address from gg appmsg service\n"); info->session = gg_login(glp); - purple_connection_update_progress(gc, _("Connecting"), 1, 2); + purple_connection_update_progress(gc, _("Connecting"), 0, 2); if (info->session == NULL) { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, @@ -2509,7 +2506,9 @@ static PurplePluginProtocolInfo prpl_info = NULL, /* get_account_text_table */ NULL, /* initiate_media */ NULL, /* can_do_media */ - NULL /* get_moods */ + NULL, /* get_moods */ + NULL, /* set_public_alias */ + NULL /* get_public_alias */ }; static PurplePluginInfo info = { diff --git a/libpurple/protocols/gg/lib/common.c b/libpurple/protocols/gg/lib/common.c index 63885b5d00..7e3ccd2337 100644 --- a/libpurple/protocols/gg/lib/common.c +++ b/libpurple/protocols/gg/lib/common.c @@ -101,7 +101,7 @@ FILE *gg_debug_file = NULL; * \param format Format wiadomości (zgodny z \c printf) * \param ap Lista argumentów (zgodna z \c printf) */ -static void gg_debug_common(struct gg_session *sess, int level, const char *format, va_list ap) +void gg_debug_common(struct gg_session *sess, int level, const char *format, va_list ap) { if (gg_debug_handler_session) (*gg_debug_handler_session)(sess, level, format, ap); diff --git a/libpurple/protocols/gg/lib/events.c b/libpurple/protocols/gg/lib/events.c index b382362842..1bf30aff54 100644 --- a/libpurple/protocols/gg/lib/events.c +++ b/libpurple/protocols/gg/lib/events.c @@ -1143,7 +1143,7 @@ static int gg_watch_fd_connected(struct gg_session *sess, struct gg_event *e) case GG_NOTIFY_REPLY80: { struct gg_notify_reply80 *n = (void*) p; - int length = h->length, i = 0; + unsigned int length = h->length, i = 0; gg_debug_session(sess, GG_DEBUG_MISC, "// gg_watch_fd_connected() received a notify reply\n"); diff --git a/libpurple/protocols/gg/lib/libgadu-internal.h b/libpurple/protocols/gg/lib/libgadu-internal.h index 07628f5122..202f89a3b9 100644 --- a/libpurple/protocols/gg/lib/libgadu-internal.h +++ b/libpurple/protocols/gg/lib/libgadu-internal.h @@ -26,5 +26,6 @@ char *gg_cp_to_utf8(const char *b); char *gg_utf8_to_cp(const char *b); int gg_pubdir50_handle_reply_sess(struct gg_session *sess, struct gg_event *e, const char *packet, int length); +void gg_debug_common(struct gg_session *sess, int level, const char *format, va_list ap); #endif /* LIBGADU_INTERNAL_H */ diff --git a/libpurple/protocols/gg/lib/libgadu.c b/libpurple/protocols/gg/lib/libgadu.c index 313afd23fc..28d95587a6 100644 --- a/libpurple/protocols/gg/lib/libgadu.c +++ b/libpurple/protocols/gg/lib/libgadu.c @@ -412,7 +412,8 @@ void *gg_recv_packet(struct gg_session *sess) { struct gg_header h; char *buf = NULL; - int ret = 0, offset, size = 0; + int ret = 0; + unsigned int offset, size = 0; gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_recv_packet(%p);\n", sess); @@ -609,7 +610,7 @@ int gg_send_packet(struct gg_session *sess, int type, ...) h->length = gg_fix32(tmp_length - sizeof(struct gg_header)); if ((gg_debug_level & GG_DEBUG_DUMP)) { - int i; + unsigned int i; gg_debug_session(sess, GG_DEBUG_DUMP, "// gg_send_packet(0x%.2x)", gg_fix32(h->type)); for (i = 0; i < tmp_length; ++i) diff --git a/libpurple/protocols/gg/lib/libgadu.h b/libpurple/protocols/gg/lib/libgadu.h index 8a06bb5837..7d84f736ef 100644 --- a/libpurple/protocols/gg/lib/libgadu.h +++ b/libpurple/protocols/gg/lib/libgadu.h @@ -117,7 +117,7 @@ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; -#ifndef __CYGWIN__ +#if !defined(__CYGWIN__) && !defined(__SunOS) #define __int8_t_defined typedef signed char int8_t; typedef signed short int16_t; @@ -1245,8 +1245,8 @@ struct gg_http *gg_change_passwd2(uin_t uin, const char *passwd, const char *new struct gg_http *gg_change_passwd3(uin_t uin, const char *passwd, const char *newpasswd, const char *qa, int async) GG_DEPRECATED; int gg_resolve(int *fd, int *pid, const char *hostname) GG_DEPRECATED; -void gg_resolve_pthread_cleanup(void *arg, int kill) GG_DEPRECATED; int gg_resolve_pthread(int *fd, void **resolver, const char *hostname) GG_DEPRECATED; +void gg_resolve_pthread_cleanup(void *arg, int kill) GG_DEPRECATED; struct gg_change_info_request { char *first_name; diff --git a/libpurple/protocols/gg/lib/resolver.c b/libpurple/protocols/gg/lib/resolver.c index 6721f92779..ce1c270faa 100644 --- a/libpurple/protocols/gg/lib/resolver.c +++ b/libpurple/protocols/gg/lib/resolver.c @@ -551,9 +551,9 @@ static int gg_resolver_fork_start(int *fd, void **priv_data, const char *hostnam } if (write(pipes[1], &addr, sizeof(addr)) != sizeof(addr)) - exit(1); + _exit(1); - exit(0); + _exit(0); } close(pipes[1]); diff --git a/libpurple/protocols/gg/search.c b/libpurple/protocols/gg/search.c index 55488d728e..7ecb7b4ff5 100644 --- a/libpurple/protocols/gg/search.c +++ b/libpurple/protocols/gg/search.c @@ -207,7 +207,7 @@ char *ggp_search_get_result(gg_pubdir50_t res, int num, const char *field) { char *tmp; - tmp = charset_convert(gg_pubdir50_get(res, num, field), "CP1250", "UTF-8"); + tmp = g_strdup(gg_pubdir50_get(res, num, field)); return (tmp == NULL) ? g_strdup("") : tmp; } |