diff --git a/Makefile b/Makefile index 08317a9..ee4ff35 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,12 @@ # # Telegram Flags # -VERSION=0.2.0 -BUILD=1 srcdir=. CFLAGS=-g LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include -DEFS=-DTG_VERSION=\"${VERSION}\" -DTG_BUILD=\"${BUILD}\" +DEFS= COMPILE_FLAGS=${CFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb EXTRA_LIBS=-lcrypto -lz -lm LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS} diff --git a/mtproto-client.c b/mtproto-client.c index 30c6a11..8e4a76c 100644 --- a/mtproto-client.c +++ b/mtproto-client.c @@ -988,7 +988,7 @@ void work_update (struct mtproto_connection *self, long long msg_id UU) { char *f = fetch_str (self, l1); int l2 = prefetch_strlen (self); char *l = fetch_str (self, l2); - struct user *U = &UC->user; + struct tgl_user *U = &UC->user; bl_do_set_user_real_name (self->bl, self, U, f, l1, l, l2); //print_start (); //push_color (COLOR_YELLOW); @@ -1012,7 +1012,7 @@ void work_update (struct mtproto_connection *self, long long msg_id UU) { peer_t *UC = user_chat_get (bl, user_id); fetch_date (self); if (UC && (UC->flags & FLAG_CREATED)) { - struct user *U = &UC->user; + struct tgl_user *U = &UC->user; unsigned y = fetch_int (self); long long photo_id; struct file_location big; diff --git a/purple-plugin/telegram-purple.c b/purple-plugin/telegram-purple.c index ab71b66..24646aa 100644 --- a/purple-plugin/telegram-purple.c +++ b/purple-plugin/telegram-purple.c @@ -549,11 +549,7 @@ void on_new_user_status(struct telegram *tg, void *peer) { telegram_conn *conn = tg->extra; peer_t *p = peer; - - // purple_debug_info(PLUGIN_ID, "New User Status: %s\n", peer->user.status.online); - // TODO: this should probably be freed again somwhere char *who = g_strdup_printf("%d", get_peer_id(p->user.id)); - PurpleAccount *account = purple_connection_get_account(conn->gc); if (p->user.status.online == 1) purple_prpl_got_user_status(account, who, "available", "message", "", NULL); diff --git a/queries.c b/queries.c index 63a57fe..a714543 100644 --- a/queries.c +++ b/queries.c @@ -48,6 +48,7 @@ #include "binlog.h" #include "telegram.h" #include "msglog.h" +#include "purple-plugin/telegram-purple.h" #define sha1 SHA1 diff --git a/telegram.c b/telegram.c index 8dee7d1..8c27259 100755 --- a/telegram.c +++ b/telegram.c @@ -39,7 +39,7 @@ void event_peer_allocated(struct telegram *instance, void *peer) /* * Peer user fetched full */ -void event_user_info_received_handler(struct telegram *instance, struct user *peer, int show_info) +void event_user_info_received_handler(struct telegram *instance, struct tgl_user *peer, int show_info) { if (instance->config->on_user_info_received_handler) { instance->config->on_user_info_received_handler (instance, peer, show_info); diff --git a/telegram.h b/telegram.h index 9e14021..5901518 100644 --- a/telegram.h +++ b/telegram.h @@ -179,7 +179,7 @@ struct telegram_config { * A callback function that is called when a peer user info was received. This is useful * for populating the GUI with new user photos. */ - void (*on_user_info_received_handler) (struct telegram *instance, struct user *peer, int showInfo); + void (*on_user_info_received_handler) (struct telegram *instance, struct tgl_user *peer, int showInfo); /** * A callback function that is called when a download is completed. This is useful @@ -404,7 +404,7 @@ void event_peer_allocated(struct telegram *instance, void *peer); /* * Load known users and chats on connect */ -void event_user_info_received_handler(struct telegram *instance, struct user *peer, int showInfo); +void event_user_info_received_handler(struct telegram *instance, struct tgl_user *peer, int showInfo); /* * Load known users and chats on connect