diff --git a/.gitignore b/.gitignore index 293b9fa..1fbc4b6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ app-hash.png .gdbinit core core* +telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/xcuserdata/matj.xcuserdatad/UserInterfaceState.xcuserstate +telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad +telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/xcuserdata/* diff --git a/Makefile b/Makefile index 08317a9..24b09db 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} @@ -89,7 +87,7 @@ strip: $(PRPL_LIBNAME) # TODO: Find a better place for server.pub install: $(PRPL_LIBNAME) install -D $(PRPL_LIBNAME) $(DESTDIR)$(PLUGIN_DIR_PURPLE)/$(PRPL_LIBNAME) - install -D tg-server.pub /etc/telegram/server.pub + install -D tg-server.pub /etc/telegram-purple/server.pub install -D purple-plugin/telegram16.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/16/telegram.png install -D purple-plugin/telegram22.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/22/telegram.png install -D purple-plugin/telegram48.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/48/telegram.png diff --git a/binlog.c b/binlog.c index 214c284..e49e655 100644 --- a/binlog.c +++ b/binlog.c @@ -273,7 +273,7 @@ void replay_log_event (struct telegram *instance) { } else { assert (!(_U->flags & FLAG_CREATED)); } - struct user *U = (void *)_U; + struct tgl_user *U = (void *)_U; U->flags |= FLAG_CREATED; if (get_peer_id (id) == instance->our_id) { U->flags |= FLAG_USER_SELF; @@ -1114,7 +1114,7 @@ void bl_do_new_user (struct binlog *bl, struct mtproto_connection *self, int id, add_log_event (bl, self, self->packet_buffer, 4 * (self->packet_ptr - self->packet_buffer)); } -void bl_do_user_delete (struct binlog *bl, struct mtproto_connection *self, struct user *U) { +void bl_do_user_delete (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U) { if (U->flags & FLAG_DELETED) { return; } int *ev = alloc_log_event (bl, 8); ev[0] = CODE_binlog_user_delete; @@ -1122,7 +1122,7 @@ void bl_do_user_delete (struct binlog *bl, struct mtproto_connection *self, stru add_log_event (bl, self, ev, 8); } -void bl_do_set_user_profile_photo (struct binlog *bl, struct mtproto_connection *self, struct user *U, +void bl_do_set_user_profile_photo (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, long long photo_id, struct file_location *big, struct file_location *small) { if (photo_id == U->photo_id) { return; } if (!photo_id) { @@ -1169,7 +1169,7 @@ void bl_do_set_user_profile_photo (struct binlog *bl, struct mtproto_connection } } -void bl_do_set_user_name (struct binlog *bl, struct mtproto_connection *self, struct user *U, const char *f, +void bl_do_set_user_name (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *f, int fl, const char *l, int ll) { if ((U->first_name && (int)strlen (U->first_name) == fl && !strncmp (U->first_name, f, fl)) && (U->last_name && (int)strlen (U->last_name) == ll && !strncmp (U->last_name, l, ll))) { @@ -1183,7 +1183,7 @@ void bl_do_set_user_name (struct binlog *bl, struct mtproto_connection *self, st add_log_event (bl, self, self->packet_buffer, 4 * (self->packet_ptr - self->packet_buffer)); } -void bl_do_set_user_access_token (struct binlog *bl, struct mtproto_connection *self, struct user *U, long long access_token) { +void bl_do_set_user_access_token (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, long long access_token) { if (U->access_hash == access_token) { return; } int *ev = alloc_log_event (bl, 16); ev[0] = CODE_binlog_set_user_access_token; @@ -1192,7 +1192,7 @@ void bl_do_set_user_access_token (struct binlog *bl, struct mtproto_connection * add_log_event (bl, self, ev, 16); } -void bl_do_set_user_phone (struct binlog *bl, struct mtproto_connection *self, struct user *U, +void bl_do_set_user_phone (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *p, int pl) { if (U->phone && (int)strlen (U->phone) == pl && !strncmp (U->phone, p, pl)) { return; @@ -1204,7 +1204,7 @@ const char *p, int pl) { add_log_event (bl, self, self->packet_buffer, 4 * (self->packet_ptr - self->packet_buffer)); } -void bl_do_set_user_friend (struct binlog *bl, struct mtproto_connection *self, struct user *U, int friend) { +void bl_do_set_user_friend (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, int friend) { if (friend == ((U->flags & FLAG_USER_CONTACT) != 0)) { return ; } int *ev = alloc_log_event (bl, 12); ev[0] = CODE_binlog_set_user_friend; @@ -1242,7 +1242,7 @@ void bl_do_set_working_dc (struct binlog *bl, struct mtproto_connection *self, i add_log_event (bl, self, ev, 8); } -void bl_do_set_user_full_photo (struct binlog *bl, struct mtproto_connection *self, struct user *U, const int *start, int len) { +void bl_do_set_user_full_photo (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const int *start, int len) { if (U->photo.id == *(long long *)(start + 1)) { return; } int *ev = alloc_log_event (bl, len + 8); ev[0] = CODE_binlog_user_full_photo; @@ -1251,7 +1251,7 @@ void bl_do_set_user_full_photo (struct binlog *bl, struct mtproto_connection *se add_log_event (bl, self, ev, len + 8); } -void bl_do_set_user_blocked (struct binlog *bl, struct mtproto_connection *self, struct user *U, int blocked) { +void bl_do_set_user_blocked (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, int blocked) { if (U->blocked == blocked) { return; } int *ev = alloc_log_event (bl, 12); ev[0] = CODE_binlog_user_blocked; @@ -1260,7 +1260,7 @@ void bl_do_set_user_blocked (struct binlog *bl, struct mtproto_connection *self, add_log_event (bl, self, ev, 12); } -void bl_do_set_user_real_name (struct binlog *bl, struct mtproto_connection *self, struct user *U, const char *f, int fl, const char *l, int ll) { +void bl_do_set_user_real_name (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *f, int fl, const char *l, int ll) { if ((U->real_first_name && (int)strlen (U->real_first_name) == fl && !strncmp (U->real_first_name, f, fl)) && (U->real_last_name && (int)strlen (U->real_last_name) == ll && !strncmp (U->real_last_name, l, ll))) { return; diff --git a/binlog.h b/binlog.h index 1f6b1ed..ac4b7b1 100644 --- a/binlog.h +++ b/binlog.h @@ -93,15 +93,15 @@ void bl_do_dc_option (struct binlog *bl, struct mtproto_connection *self, int id void bl_do_set_our_id (struct binlog *bl, struct mtproto_connection *self, int id); void bl_do_new_user (struct binlog *bl, struct mtproto_connection *self, int id, const char *f, int fl, const char *l, int ll, long long access_token, const char *p, int pl, int contact); -void bl_do_user_delete (struct binlog *bl, struct mtproto_connection *self, struct user *U); -void bl_do_set_user_profile_photo (struct binlog *bl, struct mtproto_connection *self, struct user *U, long long photo_id, struct file_location *big, struct file_location *small); -void bl_do_set_user_name (struct binlog *bl, struct mtproto_connection *self, struct user *U, const char *f, int fl, const char *l, int ll); -void bl_do_set_user_access_token (struct binlog *bl, struct mtproto_connection *self, struct user *U, long long access_token); -void bl_do_set_user_phone (struct binlog *bl, struct mtproto_connection *self, struct user *U, const char *p, int pl); -void bl_do_set_user_friend (struct binlog *bl, struct mtproto_connection *self, struct user *U, int friend); -void bl_do_set_user_full_photo (struct binlog *bl, struct mtproto_connection *self, struct user *U, const int *start, int len); -void bl_do_set_user_blocked (struct binlog *bl, struct mtproto_connection *self, struct user *U, int blocked); -void bl_do_set_user_real_name (struct binlog *bl, struct mtproto_connection *self, struct user *U, const char *f, int fl, const char *l, int ll); +void bl_do_user_delete (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U); +void bl_do_set_user_profile_photo (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, long long photo_id, struct file_location *big, struct file_location *small); +void bl_do_set_user_name (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *f, int fl, const char *l, int ll); +void bl_do_set_user_access_token (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, long long access_token); +void bl_do_set_user_phone (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *p, int pl); +void bl_do_set_user_friend (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, int friend); +void bl_do_set_user_full_photo (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const int *start, int len); +void bl_do_set_user_blocked (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, int blocked); +void bl_do_set_user_real_name (struct binlog *bl, struct mtproto_connection *self, struct tgl_user *U, const char *f, int fl, const char *l, int ll); void bl_do_encr_chat_delete (struct binlog *bl, struct mtproto_connection *self, struct secret_chat *U); void bl_do_encr_chat_requested (struct binlog *bl, struct mtproto_connection *self, struct secret_chat *U, long long access_hash, int date, int admin_id, int user_id, unsigned char g_key[], unsigned char nonce[]); diff --git a/mtproto-client.c b/mtproto-client.c index 4dd20f5..1c7a635 100644 --- a/mtproto-client.c +++ b/mtproto-client.c @@ -117,8 +117,8 @@ int Response_len; * */ -#define TG_SERVER_PUBKEY_FILENAME "/etc/telegram/server.pub" -char *rsa_public_key_name; // = TG_SERVER_PUBKEY_FILENAME; +#define TG_SERVER_PUBKEY_FILENAME "/etc/telegram-purple/server.pub" +char *rsa_public_key_name = 0; RSA *pubKey; long long pk_fingerprint; @@ -806,7 +806,7 @@ void work_update_binlog (struct mtproto_connection *self) { peer_id_t user_id = MK_USER (fetch_int (self)); peer_t *UC = user_chat_get (bl, user_id); if (UC) { - struct user *U = &UC->user; + struct tgl_user *U = &UC->user; if (U->first_name) { tfree_str (U->first_name); } if (U->last_name) { tfree_str (U->last_name); } if (U->print_name) { @@ -829,7 +829,7 @@ void work_update_binlog (struct mtproto_connection *self) { peer_t *UC = user_chat_get (bl, user_id); fetch_date (self); if (UC) { - struct user *U = &UC->user; + struct tgl_user *U = &UC->user; unsigned y = fetch_int (self); if (y == CODE_user_profile_photo_empty) { @@ -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/mtproto-client.h b/mtproto-client.h index d90a748..fe6dcc1 100644 --- a/mtproto-client.h +++ b/mtproto-client.h @@ -114,6 +114,7 @@ Copyright Nikolay Durov, Andrey Lopatin 2012-2013 #define MAX_PROTO_MESSAGE_INTS 1048576 #define _FILE_OFFSET_BITS 64 +char *rsa_public_key_name; #pragma pack(push,4) struct encrypted_message { diff --git a/net.c b/net.c index 296199f..89dfc50 100644 --- a/net.c +++ b/net.c @@ -314,11 +314,10 @@ int try_write (struct connection *c) { // Log all written packages if (r > 0 && log_net_f) { - fprintf (log_net_f, "%.02lf %d OUT %s:%d", get_utime (CLOCK_REALTIME), r, c->ip, c->port); + // fprintf (log_net_f, "%.02lf %d OUT %s:%d", get_utime (CLOCK_REALTIME), r, c->ip, c->port); int i; for (i = 0; i < r; i++) { - - fprintf (log_net_f, " %02x", *(unsigned char *)(c->out_head->rptr + i)); + // fprintf (log_net_f, " %02x", *(unsigned char *)(c->out_head->rptr + i)); } fprintf (log_net_f, "\n"); fflush (log_net_f); diff --git a/purple-plugin/telegram-purple.c b/purple-plugin/telegram-purple.c index 7e51fe0..24e9116 100644 --- a/purple-plugin/telegram-purple.c +++ b/purple-plugin/telegram-purple.c @@ -74,7 +74,7 @@ void tg_cli_log_cb(const char* format, va_list ap) void message_allocated_handler (struct telegram *instance, struct message *M); void peer_allocated_handler (struct telegram *instance, void *user); -void user_info_received_handler (struct telegram *instance, struct user *user, int showInfo); +void user_info_received_handler (struct telegram *instance, struct tgl_user *user, int showInfo); void download_finished_handler (struct telegram *instance, struct download *D); void telegram_on_phone_registration (struct telegram *instance); void telegram_on_client_registration (struct telegram *instance); @@ -353,8 +353,8 @@ void telegram_on_client_registration (struct telegram *instance) "Enter Telegram Code", // primary "Telegram wants to verify your identity, please enter the code, that you have received via SMS.", // secondary NULL, // default_value - FALSE, // multiline - FALSE, // masked + 0, // multiline + 0, // masked "code", // hint "OK", // ok_text G_CALLBACK(client_registration_entered), // ok_cb @@ -549,16 +549,12 @@ 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); else - purple_prpl_got_user_status(account, who, "unavailable", "message", "", NULL); + purple_prpl_got_user_status(account, who, "mobile", "message", "", NULL); g_free(who); } @@ -591,7 +587,7 @@ static PurpleChat *blist_find_chat_by_hasht_cond(PurpleConnection *gc, int (*fn) return ch; } } - node = purple_blist_node_next(node, FALSE); + node = purple_blist_node_next(node, 0); } return NULL; } @@ -643,7 +639,7 @@ void peer_allocated_handler(struct telegram *tg, void *usr) if (user->user.status.online == 1) purple_prpl_got_user_status(account, name, "available", "message", "", NULL); else - purple_prpl_got_user_status(account, name, "unavailable", "message", "", NULL); + purple_prpl_got_user_status(account, name, "mobile", "message", "", NULL); g_free(alias); g_free(name); @@ -682,7 +678,7 @@ void peer_allocated_handler(struct telegram *tg, void *usr) const char *cuname = g_strdup_printf("%d", cu->user_id); debug("Adding user %s to chat %s\n", cuname, name); purple_conv_chat_add_user(purple_conversation_get_chat_data(conv), cuname, "", - PURPLE_CBFLAGS_NONE | (!strcmp(owner, cuname) ? PURPLE_CBFLAGS_FOUNDER : 0), FALSE); + PURPLE_CBFLAGS_NONE | (!strcmp(owner, cuname) ? PURPLE_CBFLAGS_FOUNDER : 0), 0); } } } @@ -699,7 +695,7 @@ void peer_allocated_handler(struct telegram *tg, void *usr) } } -PurpleNotifyUserInfo *create_user_notify_info(struct user *usr) +PurpleNotifyUserInfo *create_user_notify_info(struct tgl_user *usr) { PurpleNotifyUserInfo *info = purple_notify_user_info_new(); purple_notify_user_info_add_pair(info, "First name", usr->first_name); @@ -709,7 +705,7 @@ PurpleNotifyUserInfo *create_user_notify_info(struct user *usr) return info; } -void user_info_received_handler(struct telegram *tg, struct user *usr, int show_info) +void user_info_received_handler(struct telegram *tg, struct tgl_user *usr, int show_info) { debug("Get user info. \n %d", show_info); char *who = g_strdup_printf("%d", usr->id.id); @@ -735,7 +731,7 @@ void download_finished_handler(struct telegram *tg, struct download *D) if(D->type == 0) { struct download_desc *dl_desc = D->extra; - struct user *usr = dl_desc->data; + struct tgl_user *usr = dl_desc->data; gchar *data = NULL; size_t len; GError *err = NULL; @@ -896,19 +892,19 @@ static void tgprpl_set_buddy_icon(PurpleConnection * gc, PurpleStoredImage * img static gboolean tgprpl_can_receive_file(PurpleConnection * gc, const char *who) { purple_debug_info(PLUGIN_ID, "tgprpl_can_receive_file()\n"); - return FALSE; + return 0; } /** * Checks whether offline messages to @a buddy are supported. - * @return @c TRUE if @a buddy can be sent messages while they are - * offline, or @c FALSE if not. + * @return @c 1 if @a buddy can be sent messages while they are + * offline, or @c 0 if not. */ static gboolean tgprpl_offline_message(const PurpleBuddy * buddy) { purple_debug_info(PLUGIN_ID, "tgprpl_offline_message()\n"); - return FALSE; + return 0; } /** @@ -921,15 +917,15 @@ static GList *tgprpl_status_types(PurpleAccount * acct) purple_debug_info(PLUGIN_ID, "tgprpl_status_types()\n"); GList *types = NULL; PurpleStatusType *type; - type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, "available", NULL, - TRUE, TRUE, FALSE, "message", "Message", purple_value_new(PURPLE_TYPE_STRING), NULL); + type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, NULL, NULL, + 1, 1, 0, "message", "Message", purple_value_new(PURPLE_TYPE_STRING), NULL); + types = g_list_prepend(types, type); + + type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOBILE, NULL, NULL, 1, + 1, 0, "message", "Message", purple_value_new(PURPLE_TYPE_STRING), NULL); types = g_list_prepend(types, type); - type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, "unavailable", NULL, TRUE, - TRUE, FALSE, "message", "Message", purple_value_new(PURPLE_TYPE_STRING), NULL); - types = g_list_prepend(types, type); - - type = purple_status_type_new(PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE); + type = purple_status_type_new(PURPLE_STATUS_OFFLINE, NULL, NULL, 1); types = g_list_append(types, type); return g_list_reverse(types); @@ -1270,11 +1266,11 @@ static PurplePluginInfo plugin_info = { PURPLE_PRIORITY_DEFAULT, PLUGIN_ID, "Telegram", - "0.1", - "Telegram protocol", - "Adds support for the telegram protocol to libpurple.", - "Christopher Althaus , Markus Endres , Matthias Jentsch ", - "https://bitbucket.org/telegrampurple/telegram-purple", + TG_VERSION, + "Telegram", + TG_DESCRIPTION, + TG_AUTHOR, + "https://github.com/majn/telegram-purple", NULL, // on load NULL, // on unload NULL, // on destroy @@ -1290,4 +1286,3 @@ static PurplePluginInfo plugin_info = { PURPLE_INIT_PLUGIN(telegram, tgprpl_init, plugin_info) - diff --git a/purple-plugin/telegram-purple.h b/purple-plugin/telegram-purple.h index 66ad820..25344e9 100644 --- a/purple-plugin/telegram-purple.h +++ b/purple-plugin/telegram-purple.h @@ -16,10 +16,14 @@ #ifndef __TG_PURPLE_H__ #define __TG_PURPLE_H__ -#define PLUGIN_ID "prpl-telegram" +#define PLUGIN_ID "prpl-telegram" #define TELEGRAM_AUTH_MODE_PHONE "phone" #define TELEGRAM_AUTH_MODE_SMS "sms" +#define TG_AUTHOR "Christopher Althaus , Markus Endres , Matthias Jentsch " +#define TG_DESCRIPTION "A protocol plugin that adds support for the Telegram messenger." +#define TG_VERSION "0.2.0" +#define TG_BUILD "2" #include #include "notify.h" diff --git a/queries.c b/queries.c index 3d83789..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 @@ -835,7 +836,7 @@ int msg_send_on_answer (struct query *q UU) { if (b == CODE_contacts_foreign_link_requested) { fetch_bool (mtp); } - struct user *U = fetch_alloc_user (mtp); + struct tgl_user *U = fetch_alloc_user (mtp); U->flags &= ~(FLAG_USER_IN_CONTACT | FLAG_USER_OUT_CONTACT); if (a == CODE_contacts_my_link_contact) { @@ -1760,7 +1761,7 @@ void do_get_chat_info (struct telegram *instance, peer_id_t id) { /* {{{ User info */ -void print_user_info (struct user *U) { +void print_user_info (struct tgl_user *U) { // TODO: use peer peer_t *C UU = (void *)U; @@ -1790,7 +1791,7 @@ int user_info_on_answer (struct query *q UU) { struct mtproto_connection *mtp = query_get_mtproto(q); struct show_info_extra *extra = q->extra; - struct user *U = fetch_alloc_user_full (mtp); + struct tgl_user *U = fetch_alloc_user_full (mtp); event_user_info_received_handler (mtp->instance, U, extra->show_info); tfree (extra, sizeof(struct show_info_extra)); //print_user_info (U); @@ -2233,7 +2234,7 @@ int add_contact_on_answer (struct query *q UU) { assert (fetch_int (mtp) == CODE_vector); n = fetch_int (mtp); for (i = 0; i < n ; i++) { - struct user *U = fetch_alloc_user (mtp); + struct tgl_user *U = fetch_alloc_user (mtp); //print_start (); //push_color (COLOR_YELLOW); debug ("User #%d: ", get_peer_id (U->id)); @@ -2337,7 +2338,7 @@ int contacts_search_on_answer (struct query *q UU) { //print_start (); //push_color (COLOR_YELLOW); for (i = 0; i < n; i++) { - struct user *U = fetch_alloc_user (mtp); + struct tgl_user *U = fetch_alloc_user (mtp); debug ("User "); //push_color (COLOR_RED); debug ("%s %s", U->first_name, U->last_name); diff --git a/structures.c b/structures.c index d7feadb..ed30181 100644 --- a/structures.c +++ b/structures.c @@ -164,7 +164,7 @@ char *create_print_name (struct binlog *bl, peer_id_t id, const char *a1, const * */ -long long fetch_user_photo (struct mtproto_connection *mtp, struct user *U) { +long long fetch_user_photo (struct mtproto_connection *mtp, struct tgl_user *U) { unsigned x = fetch_int (mtp); code_assert (x == CODE_user_profile_photo || x == CODE_user_profile_photo_old || x == CODE_user_profile_photo_empty); if (x == CODE_user_profile_photo_empty) { @@ -199,7 +199,7 @@ int user_get_alias(peer_t *user, char *buffer, int maxlen) } } -int fetch_user (struct mtproto_connection *mtp, struct user *U) { +int fetch_user (struct mtproto_connection *mtp, struct tgl_user *U) { struct telegram *instance = mtp->instance; unsigned x = fetch_int (mtp); @@ -408,7 +408,7 @@ void fetch_encrypted_chat (struct mtproto_connection *mtp, struct secret_chat *U } void fetch_notify_settings (struct mtproto_connection *mtp); -void fetch_user_full (struct mtproto_connection *mtp, struct user *U) { +void fetch_user_full (struct mtproto_connection *mtp, struct tgl_user *U) { assert (fetch_int (mtp) == CODE_user_full); fetch_alloc_user (mtp); unsigned x; @@ -1522,7 +1522,7 @@ static int id_cmp (struct message *M1, struct message *M2) { else { return 0; } } -struct user *fetch_alloc_user (struct mtproto_connection *mtp) { +struct tgl_user *fetch_alloc_user (struct mtproto_connection *mtp) { struct binlog *bl = mtp->instance->bl; debug("fetch_alloc_user()\n"); @@ -1587,7 +1587,7 @@ void insert_chat (struct binlog *bl, peer_t *P) { bl->Peers[bl->peer_num ++] = P; } -struct user *fetch_alloc_user_full (struct mtproto_connection *mtp) { +struct tgl_user *fetch_alloc_user_full (struct mtproto_connection *mtp) { struct binlog *bl = mtp->bl; int data[3]; prefetch_data (mtp, data, 12); @@ -1607,7 +1607,7 @@ struct user *fetch_alloc_user_full (struct mtproto_connection *mtp) { } } -void free_user (struct user *U) { +void free_user (struct tgl_user *U) { if (U->first_name) { tfree_str (U->first_name); } if (U->last_name) { tfree_str (U->last_name); } if (U->print_name) { tfree_str (U->print_name); } diff --git a/structures.h b/structures.h index 00bef50..cc4ce08 100644 --- a/structures.h +++ b/structures.h @@ -142,7 +142,7 @@ struct user_status { int when; }; -struct user { +struct tgl_user { peer_id_t id; int flags; struct message *last; @@ -229,7 +229,7 @@ typedef union peer { struct file_location photo_small; struct photo photo; }; - struct user user; + struct tgl_user user; struct chat chat; struct secret_chat encr_chat; } peer_t; @@ -337,9 +337,9 @@ struct message { int fetch_file_location (struct mtproto_connection *mtp, struct file_location *loc); int fetch_user_status (struct mtproto_connection *mtp, struct user_status *S); -int fetch_user (struct mtproto_connection *mtp, struct user *U); -struct user *fetch_alloc_user (struct mtproto_connection *mtp); -struct user *fetch_alloc_user_full (struct mtproto_connection *mtp); +int fetch_user (struct mtproto_connection *mtp, struct tgl_user *U); +struct tgl_user *fetch_alloc_user (struct mtproto_connection *mtp); +struct tgl_user *fetch_alloc_user_full (struct mtproto_connection *mtp); struct chat *fetch_alloc_chat (struct mtproto_connection *mtp); struct chat *fetch_alloc_chat_full (struct mtproto_connection *mtp); struct secret_chat *fetch_alloc_encrypted_chat (struct mtproto_connection *mtp); @@ -358,7 +358,7 @@ void fetch_message_media_encrypted (struct mtproto_connection *mtp, struct messa void fetch_message_action (struct mtproto_connection *mtp, struct message_action *M); void message_insert_tree (struct message *M); -void free_user (struct user *U); +void free_user (struct tgl_user *U); void free_chat (struct chat *U); char *create_print_name (struct binlog *bl, peer_id_t id, const char *a1, const char *a2, const char *a3, const char *a4); diff --git a/telegram-adium/AdiumTelegramAccount.h b/telegram-adium/AdiumTelegramAccount.h new file mode 100644 index 0000000..7d9fe27 --- /dev/null +++ b/telegram-adium/AdiumTelegramAccount.h @@ -0,0 +1,22 @@ +/** + * 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 + */ + +#import +#import + +@interface AdiumTelegramAccount : CBPurpleAccount + +@end diff --git a/telegram-adium/AdiumTelegramAccount.m b/telegram-adium/AdiumTelegramAccount.m new file mode 100644 index 0000000..154664e --- /dev/null +++ b/telegram-adium/AdiumTelegramAccount.m @@ -0,0 +1,41 @@ +/** + * 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 + */ + +#import "AdiumTelegramAccount.h" + +@implementation AdiumTelegramAccount + +- (const char*)protocolPlugin +{ + return "prpl-telegram"; +} + +- (NSString *)host +{ + return @"149.154.167.50"; +} + +- (int)port +{ + return 443; +} + +- (BOOL)canSendOfflineMessageToContact:(AIListContact *)inContact +{ + return YES; +} + +@end diff --git a/telegram-adium/TelegramPlugin.h b/telegram-adium/TelegramPlugin.h new file mode 100644 index 0000000..cce5641 --- /dev/null +++ b/telegram-adium/TelegramPlugin.h @@ -0,0 +1,23 @@ +/** + * 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 + */ + +#import +#import + +@interface TelegramPlugin : AIPlugin { + +} +@end diff --git a/telegram-adium/TelegramPlugin.m b/telegram-adium/TelegramPlugin.m new file mode 100644 index 0000000..acbf619 --- /dev/null +++ b/telegram-adium/TelegramPlugin.m @@ -0,0 +1,69 @@ +/** + * 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 + */ + +#import "TelegramPlugin.h" +#import "TelegramService.h" +#import "telegram-purple.h" +#import "mtproto-client.h" + +extern void purple_init_telegram_plugin(); + +@implementation TelegramPlugin + +- (void) installPlugin +{ + rsa_public_key_name = [self getPkName]; + purple_init_telegram_plugin(); + [TelegramService registerService]; +} + +- (void) installLibpurplePlugin +{ +} + +- (void) loadLibpurplePlugin +{ +} + +- (void) uninstallPlugin +{ +} + +- (NSString *)pluginAuthor +{ + return @TG_AUTHOR; +} + +-(NSString *)pluginVersion +{ + return @TG_VERSION; +} + +-(NSString *)pluginDescription +{ + return @"Telegram"; +} + +-(char*)getPkName +{ + const char* utf8String = (char *)[[[NSBundle bundleForClass: [self class]] pathForResource: @"tg-server" ofType: @"pub"] UTF8String]; + size_t len = strlen(utf8String) + 1; + char *buf = talloc0(len); + memcpy(buf, utf8String, len); + return buf; +} + +@end diff --git a/telegram-adium/TelegramService.h b/telegram-adium/TelegramService.h new file mode 100644 index 0000000..2071314 --- /dev/null +++ b/telegram-adium/TelegramService.h @@ -0,0 +1,24 @@ +/** + * 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 + */ + +#import +#import + +@interface TelegramService : PurpleService { + +} + +@end diff --git a/telegram-adium/TelegramService.m b/telegram-adium/TelegramService.m new file mode 100644 index 0000000..c4ed743 --- /dev/null +++ b/telegram-adium/TelegramService.m @@ -0,0 +1,140 @@ +/** + * 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 + */ + +#import "TelegramService.h" +#import "AdiumTelegramAccount.h" + +#import +#import + +@implementation TelegramService + +- (Class)accountClass{ + return [AdiumTelegramAccount class]; +} + +//Service Description +- (NSString *)serviceCodeUniqueID{ + return @"prpl-telegram"; +} + +- (NSString *)serviceID{ + return @"Telegram"; +} + +- (NSString *)serviceClass{ + return @"Telegram"; +} + +- (NSString *)shortDescription{ + return @"Telegram"; +} + +- (NSString *)longDescription{ + return @"Telegram"; +} + +- (NSString *)userNameLabel +{ + return @"Phone Number"; +} + +- (BOOL)supportsProxySettings{ + return YES; +} + +- (BOOL)supportsPassword +{ + return NO; +} + +- (BOOL)requiresPassword +{ + return NO; +} + +- (BOOL)canCreateGroupChats +{ + return YES; +} + +- (NSString *)UIDPlaceholder +{ + return @"e.g. +49157123456"; +} + +- (BOOL)isSocialNetworkingService +{ + return YES; +} + +- (AIServiceImportance)serviceImportance{ + return AIServiceSecondary; +} + +- (NSCharacterSet *)allowedCharacters{ + return [[NSCharacterSet illegalCharacterSet] invertedSet]; +} + +- (NSCharacterSet *)allowedCharactersForAccountName +{ + return ([NSCharacterSet characterSetWithCharactersInString: @"+1234567890"]); +} + +- (NSUInteger)allowedLengthForAccountName +{ + return 16; +} + +- (NSCharacterSet *)ignoredCharacters{ + return [NSCharacterSet characterSetWithCharactersInString:@"/-"]; +} + +- (BOOL)caseSensitive{ + return NO; +} + +- (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType +{ + if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) { + return [NSImage imageNamed:@"telegram16" forClass:[self class] loadLazily:YES]; + } else { + return [NSImage imageNamed:@"telegram" forClass:[self class] loadLazily:YES]; + } +} + +- (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType +{ + if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) { + return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"telegram16"]; + } + return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"telegram"]; +} + +- (void)registerStatuses { +#define ADDSTATUS(name, type) \ +[adium.statusController registerStatus:name \ +withDescription:[adium.statusController localizedDescriptionForCoreStatusName:name] \ +ofType:type forService:self] + + [adium.statusController registerStatus:STATUS_NAME_AVAILABLE withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE] ofType:AIAvailableStatusType forService:self]; + + ADDSTATUS(STATUS_NAME_AVAILABLE, AIAvailableStatusType); + ADDSTATUS(STATUS_NAME_NOT_AVAILABLE, AIAvailableStatusType); + ADDSTATUS(STATUS_NAME_OFFLINE, AIOfflineStatusType); +} + +@end diff --git a/telegram-adium/libcrypto.a b/telegram-adium/libcrypto.a new file mode 100644 index 0000000..234df55 Binary files /dev/null and b/telegram-adium/libcrypto.a differ diff --git a/telegram-adium/telegram-adium.xcodeproj/project.pbxproj b/telegram-adium/telegram-adium.xcodeproj/project.pbxproj new file mode 100644 index 0000000..069b0c7 --- /dev/null +++ b/telegram-adium/telegram-adium.xcodeproj/project.pbxproj @@ -0,0 +1,514 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C410948A19BB2D7D0083BF3F /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C410948919BB2D7D0083BF3F /* CoreFoundation.framework */; }; + C410949019BB2D7D0083BF3F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C410948E19BB2D7D0083BF3F /* InfoPlist.strings */; }; + C410949B19BB337A0083BF3F /* TelegramPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = C410949A19BB337A0083BF3F /* TelegramPlugin.m */; }; + C4877C1819BB37EA006FA91F /* TelegramService.m in Sources */ = {isa = PBXBuildFile; fileRef = C4877C1719BB37EA006FA91F /* TelegramService.m */; }; + C4877C1A19BB3D91006FA91F /* telegram-purple.c in Sources */ = {isa = PBXBuildFile; fileRef = C4877C1919BB3D91006FA91F /* telegram-purple.c */; }; + C4877C1E19BB676B006FA91F /* AdiumTelegramAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = C4877C1D19BB676B006FA91F /* AdiumTelegramAccount.m */; }; + C4877C2419BB6D11006FA91F /* telegram.svg in Resources */ = {isa = PBXBuildFile; fileRef = C4877C1F19BB6D11006FA91F /* telegram.svg */; }; + C4877C2519BB6D11006FA91F /* telegram.png in Resources */ = {isa = PBXBuildFile; fileRef = C4877C2019BB6D11006FA91F /* telegram.png */; }; + C4877C2619BB6D11006FA91F /* telegram16.png in Resources */ = {isa = PBXBuildFile; fileRef = C4877C2119BB6D11006FA91F /* telegram16.png */; }; + C4877C2719BB6D11006FA91F /* telegram22.png in Resources */ = {isa = PBXBuildFile; fileRef = C4877C2219BB6D11006FA91F /* telegram22.png */; }; + C4877C2819BB6D11006FA91F /* telegram48.png in Resources */ = {isa = PBXBuildFile; fileRef = C4877C2319BB6D11006FA91F /* telegram48.png */; }; + C49A915619BBC278001B3DC0 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C49A915519BBC278001B3DC0 /* libcrypto.a */; }; + C49A915819BBC5C5001B3DC0 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C49A915719BBC5C5001B3DC0 /* libz.dylib */; }; + C4B81AE319E084B800E9177C /* libglib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AE219E084B800E9177C /* libglib.framework */; }; + C4B81AE519E084C300E9177C /* libgmodule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AE419E084C300E9177C /* libgmodule.framework */; }; + C4B81AE719E084D500E9177C /* libgobject.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AE619E084D500E9177C /* libgobject.framework */; }; + C4B81AE919E084DE00E9177C /* libgthread.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AE819E084DE00E9177C /* libgthread.framework */; }; + C4B81AEB19E084E500E9177C /* libintl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AEA19E084E500E9177C /* libintl.framework */; }; + C4B81AED19E084ED00E9177C /* libmeanwhile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AEC19E084ED00E9177C /* libmeanwhile.framework */; }; + C4B81AEF19E084F600E9177C /* libpurple.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AEE19E084F600E9177C /* libpurple.framework */; }; + C4B81AF119E087AF00E9177C /* AIUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AF019E087AF00E9177C /* AIUtilities.framework */; }; + C4B81AF319E087BA00E9177C /* AdiumLibpurple.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AF219E087BA00E9177C /* AdiumLibpurple.framework */; }; + C4B81AF519E087C500E9177C /* Adium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B81AF419E087C500E9177C /* Adium.framework */; }; + C4B81AF919E15E0D00E9177C /* tg-server.pub in Resources */ = {isa = PBXBuildFile; fileRef = C4B81AF619E0B67600E9177C /* tg-server.pub */; }; + C4BF991C19BB8B4D0038D507 /* binlog.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990419BB8B4D0038D507 /* binlog.c */; }; + C4BF991D19BB8B4D0038D507 /* loop.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990519BB8B4D0038D507 /* loop.c */; }; + C4BF991E19BB8B4D0038D507 /* msglog.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990619BB8B4D0038D507 /* msglog.c */; }; + C4BF991F19BB8B4D0038D507 /* mtproto-client.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990719BB8B4D0038D507 /* mtproto-client.c */; }; + C4BF992019BB8B4D0038D507 /* mtproto-common.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990819BB8B4D0038D507 /* mtproto-common.c */; }; + C4BF992119BB8B4D0038D507 /* net.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990919BB8B4D0038D507 /* net.c */; }; + C4BF992219BB8B4D0038D507 /* queries.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990A19BB8B4D0038D507 /* queries.c */; }; + C4BF992319BB8B4D0038D507 /* structures.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990B19BB8B4D0038D507 /* structures.c */; }; + C4BF992419BB8B4D0038D507 /* telegram.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990C19BB8B4D0038D507 /* telegram.c */; }; + C4BF992519BB8B4D0038D507 /* tools.c in Sources */ = {isa = PBXBuildFile; fileRef = C4BF990D19BB8B4D0038D507 /* tools.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + C410948619BB2D7D0083BF3F /* telegram-adium.AdiumLibpurplePlugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "telegram-adium.AdiumLibpurplePlugin"; sourceTree = BUILT_PRODUCTS_DIR; }; + C410948919BB2D7D0083BF3F /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + C410948D19BB2D7D0083BF3F /* telegram-adium-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "telegram-adium-Info.plist"; sourceTree = ""; }; + C410948F19BB2D7D0083BF3F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C410949119BB2D7D0083BF3F /* telegram-adium-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "telegram-adium-Prefix.pch"; sourceTree = ""; }; + C410949919BB337A0083BF3F /* TelegramPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TelegramPlugin.h; sourceTree = ""; }; + C410949A19BB337A0083BF3F /* TelegramPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TelegramPlugin.m; sourceTree = ""; }; + C4877C1619BB37EA006FA91F /* TelegramService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TelegramService.h; sourceTree = ""; }; + C4877C1719BB37EA006FA91F /* TelegramService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TelegramService.m; sourceTree = ""; }; + C4877C1919BB3D91006FA91F /* telegram-purple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "telegram-purple.c"; path = "../purple-plugin/telegram-purple.c"; sourceTree = ""; }; + C4877C1B19BB3DA9006FA91F /* telegram-purple.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "telegram-purple.h"; path = "../purple-plugin/telegram-purple.h"; sourceTree = ""; }; + C4877C1C19BB676B006FA91F /* AdiumTelegramAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdiumTelegramAccount.h; sourceTree = ""; }; + C4877C1D19BB676B006FA91F /* AdiumTelegramAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdiumTelegramAccount.m; sourceTree = ""; }; + C4877C1F19BB6D11006FA91F /* telegram.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = telegram.svg; path = "../purple-plugin/telegram.svg"; sourceTree = ""; }; + C4877C2019BB6D11006FA91F /* telegram.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = telegram.png; path = "../purple-plugin/telegram.png"; sourceTree = ""; }; + C4877C2119BB6D11006FA91F /* telegram16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = telegram16.png; path = "../purple-plugin/telegram16.png"; sourceTree = ""; }; + C4877C2219BB6D11006FA91F /* telegram22.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = telegram22.png; path = "../purple-plugin/telegram22.png"; sourceTree = ""; }; + C4877C2319BB6D11006FA91F /* telegram48.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = telegram48.png; path = "../purple-plugin/telegram48.png"; sourceTree = ""; }; + C49A915519BBC278001B3DC0 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; + C49A915719BBC5C5001B3DC0 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + C4B81AE219E084B800E9177C /* libglib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libglib.framework; path = "../../adium-1.5.10/Frameworks/libglib.framework"; sourceTree = ""; }; + C4B81AE419E084C300E9177C /* libgmodule.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libgmodule.framework; path = "../../adium-1.5.10/Frameworks/libgmodule.framework"; sourceTree = ""; }; + C4B81AE619E084D500E9177C /* libgobject.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libgobject.framework; path = "../../adium-1.5.10/Frameworks/libgobject.framework"; sourceTree = ""; }; + C4B81AE819E084DE00E9177C /* libgthread.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libgthread.framework; path = "../../adium-1.5.10/Frameworks/libgthread.framework"; sourceTree = ""; }; + C4B81AEA19E084E500E9177C /* libintl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libintl.framework; path = "../../adium-1.5.10/Frameworks/libintl.framework"; sourceTree = ""; }; + C4B81AEC19E084ED00E9177C /* libmeanwhile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libmeanwhile.framework; path = "../../adium-1.5.10/Frameworks/libmeanwhile.framework"; sourceTree = ""; }; + C4B81AEE19E084F600E9177C /* libpurple.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libpurple.framework; path = "../../adium-1.5.10/Frameworks/libpurple.framework"; sourceTree = ""; }; + C4B81AF019E087AF00E9177C /* AIUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AIUtilities.framework; path = "../../../Library/Developer/Xcode/DerivedData/Adium-gdszlkyrczkyzvfhyhsigfyepffb/Build/Products/Debug/AIUtilities.framework"; sourceTree = ""; }; + C4B81AF219E087BA00E9177C /* AdiumLibpurple.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdiumLibpurple.framework; path = "../../../Library/Developer/Xcode/DerivedData/Adium-gdszlkyrczkyzvfhyhsigfyepffb/Build/Products/Debug/AdiumLibpurple.framework"; sourceTree = ""; }; + C4B81AF419E087C500E9177C /* Adium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Adium.framework; path = "../../../Library/Developer/Xcode/DerivedData/Adium-gdszlkyrczkyzvfhyhsigfyepffb/Build/Products/Debug/Adium.framework"; sourceTree = ""; }; + C4B81AF619E0B67600E9177C /* tg-server.pub */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "tg-server.pub"; path = "../tg-server.pub"; sourceTree = ""; }; + C4BF990419BB8B4D0038D507 /* binlog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = binlog.c; path = ../binlog.c; sourceTree = ""; }; + C4BF990519BB8B4D0038D507 /* loop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loop.c; path = ../loop.c; sourceTree = ""; }; + C4BF990619BB8B4D0038D507 /* msglog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = msglog.c; path = ../msglog.c; sourceTree = ""; }; + C4BF990719BB8B4D0038D507 /* mtproto-client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "mtproto-client.c"; path = "../mtproto-client.c"; sourceTree = ""; }; + C4BF990819BB8B4D0038D507 /* mtproto-common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "mtproto-common.c"; path = "../mtproto-common.c"; sourceTree = ""; }; + C4BF990919BB8B4D0038D507 /* net.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = net.c; path = ../net.c; sourceTree = ""; }; + C4BF990A19BB8B4D0038D507 /* queries.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = queries.c; path = ../queries.c; sourceTree = ""; }; + C4BF990B19BB8B4D0038D507 /* structures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = structures.c; path = ../structures.c; sourceTree = ""; }; + C4BF990C19BB8B4D0038D507 /* telegram.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = telegram.c; path = ../telegram.c; sourceTree = ""; }; + C4BF990D19BB8B4D0038D507 /* tools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tools.c; path = ../tools.c; sourceTree = ""; }; + C4BF990E19BB8B4D0038D507 /* binlog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = binlog.h; path = ../binlog.h; sourceTree = ""; }; + C4BF990F19BB8B4D0038D507 /* constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = constants.h; path = ../constants.h; sourceTree = ""; }; + C4BF991019BB8B4D0038D507 /* include.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = include.h; path = ../include.h; sourceTree = ""; }; + C4BF991119BB8B4D0038D507 /* LICENSE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LICENSE.h; path = ../LICENSE.h; sourceTree = ""; }; + C4BF991219BB8B4D0038D507 /* loop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = loop.h; path = ../loop.h; sourceTree = ""; }; + C4BF991319BB8B4D0038D507 /* msglog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msglog.h; path = ../msglog.h; sourceTree = ""; }; + C4BF991419BB8B4D0038D507 /* mtproto-client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "mtproto-client.h"; path = "../mtproto-client.h"; sourceTree = ""; }; + C4BF991519BB8B4D0038D507 /* net.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = net.h; path = ../net.h; sourceTree = ""; }; + C4BF991619BB8B4D0038D507 /* no-preview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "no-preview.h"; path = "../no-preview.h"; sourceTree = ""; }; + C4BF991719BB8B4D0038D507 /* queries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = queries.h; path = ../queries.h; sourceTree = ""; }; + C4BF991819BB8B4D0038D507 /* structures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = structures.h; path = ../structures.h; sourceTree = ""; }; + C4BF991919BB8B4D0038D507 /* telegram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = telegram.h; path = ../telegram.h; sourceTree = ""; }; + C4BF991A19BB8B4D0038D507 /* tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tools.h; path = ../tools.h; sourceTree = ""; }; + C4BF991B19BB8B4D0038D507 /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tree.h; path = ../tree.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C410948319BB2D7D0083BF3F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C49A915819BBC5C5001B3DC0 /* libz.dylib in Frameworks */, + C49A915619BBC278001B3DC0 /* libcrypto.a in Frameworks */, + C4B81AE519E084C300E9177C /* libgmodule.framework in Frameworks */, + C4B81AF319E087BA00E9177C /* AdiumLibpurple.framework in Frameworks */, + C4B81AEB19E084E500E9177C /* libintl.framework in Frameworks */, + C4B81AE319E084B800E9177C /* libglib.framework in Frameworks */, + C4B81AF519E087C500E9177C /* Adium.framework in Frameworks */, + C410948A19BB2D7D0083BF3F /* CoreFoundation.framework in Frameworks */, + C4B81AEF19E084F600E9177C /* libpurple.framework in Frameworks */, + C4B81AF119E087AF00E9177C /* AIUtilities.framework in Frameworks */, + C4B81AED19E084ED00E9177C /* libmeanwhile.framework in Frameworks */, + C4B81AE919E084DE00E9177C /* libgthread.framework in Frameworks */, + C4B81AE719E084D500E9177C /* libgobject.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C410947D19BB2D7D0083BF3F = { + isa = PBXGroup; + children = ( + C410949919BB337A0083BF3F /* TelegramPlugin.h */, + C410949A19BB337A0083BF3F /* TelegramPlugin.m */, + C4877C1619BB37EA006FA91F /* TelegramService.h */, + C4877C1719BB37EA006FA91F /* TelegramService.m */, + C4877C1C19BB676B006FA91F /* AdiumTelegramAccount.h */, + C4877C1D19BB676B006FA91F /* AdiumTelegramAccount.m */, + C4BF990319BB8B200038D507 /* telegram-purple */, + C4BF992619BB8B530038D507 /* telegram */, + C410948B19BB2D7D0083BF3F /* telegram-adium */, + C410948819BB2D7D0083BF3F /* Frameworks */, + C410948719BB2D7D0083BF3F /* Products */, + C4877C2919BB6D22006FA91F /* Resources */, + ); + sourceTree = ""; + }; + C410948719BB2D7D0083BF3F /* Products */ = { + isa = PBXGroup; + children = ( + C410948619BB2D7D0083BF3F /* telegram-adium.AdiumLibpurplePlugin */, + ); + name = Products; + sourceTree = ""; + }; + C410948819BB2D7D0083BF3F /* Frameworks */ = { + isa = PBXGroup; + children = ( + C4B81AE419E084C300E9177C /* libgmodule.framework */, + C4B81AE219E084B800E9177C /* libglib.framework */, + C4B81AF419E087C500E9177C /* Adium.framework */, + C4B81AF219E087BA00E9177C /* AdiumLibpurple.framework */, + C4B81AF019E087AF00E9177C /* AIUtilities.framework */, + C4B81AEE19E084F600E9177C /* libpurple.framework */, + C4B81AEC19E084ED00E9177C /* libmeanwhile.framework */, + C4B81AEA19E084E500E9177C /* libintl.framework */, + C4B81AE819E084DE00E9177C /* libgthread.framework */, + C4B81AE619E084D500E9177C /* libgobject.framework */, + C49A915719BBC5C5001B3DC0 /* libz.dylib */, + C49A915519BBC278001B3DC0 /* libcrypto.a */, + C410948919BB2D7D0083BF3F /* CoreFoundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C410948B19BB2D7D0083BF3F /* telegram-adium */ = { + isa = PBXGroup; + children = ( + C410948C19BB2D7D0083BF3F /* Supporting Files */, + ); + path = "telegram-adium"; + sourceTree = ""; + }; + C410948C19BB2D7D0083BF3F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C410948D19BB2D7D0083BF3F /* telegram-adium-Info.plist */, + C410948E19BB2D7D0083BF3F /* InfoPlist.strings */, + C410949119BB2D7D0083BF3F /* telegram-adium-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C4877C2919BB6D22006FA91F /* Resources */ = { + isa = PBXGroup; + children = ( + C4877C1F19BB6D11006FA91F /* telegram.svg */, + C4877C2019BB6D11006FA91F /* telegram.png */, + C4877C2119BB6D11006FA91F /* telegram16.png */, + C4877C2219BB6D11006FA91F /* telegram22.png */, + C4877C2319BB6D11006FA91F /* telegram48.png */, + ); + name = Resources; + sourceTree = ""; + }; + C4BF990319BB8B200038D507 /* telegram-purple */ = { + isa = PBXGroup; + children = ( + C4877C1B19BB3DA9006FA91F /* telegram-purple.h */, + C4877C1919BB3D91006FA91F /* telegram-purple.c */, + ); + name = "telegram-purple"; + sourceTree = ""; + }; + C4BF992619BB8B530038D507 /* telegram */ = { + isa = PBXGroup; + children = ( + C4B81AF619E0B67600E9177C /* tg-server.pub */, + C4BF990419BB8B4D0038D507 /* binlog.c */, + C4BF990519BB8B4D0038D507 /* loop.c */, + C4BF990619BB8B4D0038D507 /* msglog.c */, + C4BF990719BB8B4D0038D507 /* mtproto-client.c */, + C4BF990819BB8B4D0038D507 /* mtproto-common.c */, + C4BF990919BB8B4D0038D507 /* net.c */, + C4BF990A19BB8B4D0038D507 /* queries.c */, + C4BF990B19BB8B4D0038D507 /* structures.c */, + C4BF990C19BB8B4D0038D507 /* telegram.c */, + C4BF990D19BB8B4D0038D507 /* tools.c */, + C4BF990E19BB8B4D0038D507 /* binlog.h */, + C4BF990F19BB8B4D0038D507 /* constants.h */, + C4BF991019BB8B4D0038D507 /* include.h */, + C4BF991119BB8B4D0038D507 /* LICENSE.h */, + C4BF991219BB8B4D0038D507 /* loop.h */, + C4BF991319BB8B4D0038D507 /* msglog.h */, + C4BF991419BB8B4D0038D507 /* mtproto-client.h */, + C4BF991519BB8B4D0038D507 /* net.h */, + C4BF991619BB8B4D0038D507 /* no-preview.h */, + C4BF991719BB8B4D0038D507 /* queries.h */, + C4BF991819BB8B4D0038D507 /* structures.h */, + C4BF991919BB8B4D0038D507 /* telegram.h */, + C4BF991A19BB8B4D0038D507 /* tools.h */, + C4BF991B19BB8B4D0038D507 /* tree.h */, + ); + name = telegram; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C410948519BB2D7D0083BF3F /* telegram-adium */ = { + isa = PBXNativeTarget; + buildConfigurationList = C410949419BB2D7D0083BF3F /* Build configuration list for PBXNativeTarget "telegram-adium" */; + buildPhases = ( + C410948219BB2D7D0083BF3F /* Sources */, + C410948319BB2D7D0083BF3F /* Frameworks */, + C410948419BB2D7D0083BF3F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "telegram-adium"; + productName = "telegram-adium"; + productReference = C410948619BB2D7D0083BF3F /* telegram-adium.AdiumLibpurplePlugin */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C410947E19BB2D7D0083BF3F /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = "Matthias Jentsch"; + }; + buildConfigurationList = C410948119BB2D7D0083BF3F /* Build configuration list for PBXProject "telegram-adium" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C410947D19BB2D7D0083BF3F; + productRefGroup = C410948719BB2D7D0083BF3F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C410948519BB2D7D0083BF3F /* telegram-adium */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C410948419BB2D7D0083BF3F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C4B81AF919E15E0D00E9177C /* tg-server.pub in Resources */, + C410949019BB2D7D0083BF3F /* InfoPlist.strings in Resources */, + C4877C2619BB6D11006FA91F /* telegram16.png in Resources */, + C4877C2519BB6D11006FA91F /* telegram.png in Resources */, + C4877C2419BB6D11006FA91F /* telegram.svg in Resources */, + C4877C2819BB6D11006FA91F /* telegram48.png in Resources */, + C4877C2719BB6D11006FA91F /* telegram22.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C410948219BB2D7D0083BF3F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C4BF992219BB8B4D0038D507 /* queries.c in Sources */, + C4BF991C19BB8B4D0038D507 /* binlog.c in Sources */, + C4877C1819BB37EA006FA91F /* TelegramService.m in Sources */, + C4BF992519BB8B4D0038D507 /* tools.c in Sources */, + C4BF991F19BB8B4D0038D507 /* mtproto-client.c in Sources */, + C4877C1A19BB3D91006FA91F /* telegram-purple.c in Sources */, + C4BF992319BB8B4D0038D507 /* structures.c in Sources */, + C4BF992019BB8B4D0038D507 /* mtproto-common.c in Sources */, + C4BF992419BB8B4D0038D507 /* telegram.c in Sources */, + C4BF991D19BB8B4D0038D507 /* loop.c in Sources */, + C410949B19BB337A0083BF3F /* TelegramPlugin.m in Sources */, + C4877C1E19BB676B006FA91F /* AdiumTelegramAccount.m in Sources */, + C4BF991E19BB8B4D0038D507 /* msglog.c in Sources */, + C4BF992119BB8B4D0038D507 /* net.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + C410948E19BB2D7D0083BF3F /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + C410948F19BB2D7D0083BF3F /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C410949219BB2D7D0083BF3F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + C410949319BB2D7D0083BF3F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + }; + name = Release; + }; + C410949519BB2D7D0083BF3F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + COMBINE_HIDPI_IMAGES = YES; + CONFIGURATION_BUILD_DIR = "$(HOME)/Library/Application Support/Adium 2.0/PlugIns/"; + DEPLOYMENT_LOCATION = YES; + DEPLOYMENT_POSTPROCESSING = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "/Users/matj/Library/Developer/Xcode/DerivedData/Adium-gdwrwbgfopymlzesvaaamabjdyym", + "/Users/matj/Development/adium-1.5.10/Frameworks", + "/Users/matj/Development/adium-1.5.10/build/Debug", + /Volumes/Workspace/adium/Frameworks, + "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Adium-gdszlkyrczkyzvfhyhsigfyepffb/Build/Products/Debug", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "telegram-adium/telegram-adium-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "/Users/matj/Development/adium-1.5.10/Frameworks/libpurple.framework/Headers", + "/Users/matj/Development/adium-1.5.10/Frameworks/libglib.framework/Headers/glib", + "/Users/matj/Development/adium-1.5.10/Frameworks/libglib.framework/Headers", + ); + INFOPLIST_FILE = "telegram-adium/telegram-adium-Info.plist"; + INSTALL_PATH = "$(HOME)/Library/Application Support/Adium 2.0/PlugIns/"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + OTHER_CFLAGS = "-DPURPLE_STATIC_PRPL"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = AdiumLibpurplePlugin; + }; + name = Debug; + }; + C410949619BB2D7D0083BF3F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + COMBINE_HIDPI_IMAGES = YES; + CONFIGURATION_BUILD_DIR = "$(HOME)/Library/Application Support/Adium 2.0/PlugIns/"; + DEPLOYMENT_LOCATION = YES; + DEPLOYMENT_POSTPROCESSING = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "/Users/matj/Library/Developer/Xcode/DerivedData/Adium-gdwrwbgfopymlzesvaaamabjdyym", + "/Users/matj/Development/adium-1.5.10/Frameworks", + "/Users/matj/Development/adium-1.5.10/build/Debug", + /Volumes/Workspace/adium/Frameworks, + "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Adium-gdszlkyrczkyzvfhyhsigfyepffb/Build/Products/Debug", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "telegram-adium/telegram-adium-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "/Users/matj/Development/adium-1.5.10/Frameworks/libpurple.framework/Headers", + "/Users/matj/Development/adium-1.5.10/Frameworks/libglib.framework/Headers/glib", + "/Users/matj/Development/adium-1.5.10/Frameworks/libglib.framework/Headers", + ); + INFOPLIST_FILE = "telegram-adium/telegram-adium-Info.plist"; + INSTALL_PATH = "$(HOME)/Library/Application Support/Adium 2.0/PlugIns/"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + OTHER_CFLAGS = "-DPURPLE_STATIC_PRPL"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = AdiumLibpurplePlugin; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C410948119BB2D7D0083BF3F /* Build configuration list for PBXProject "telegram-adium" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C410949219BB2D7D0083BF3F /* Debug */, + C410949319BB2D7D0083BF3F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + C410949419BB2D7D0083BF3F /* Build configuration list for PBXNativeTarget "telegram-adium" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C410949519BB2D7D0083BF3F /* Debug */, + C410949619BB2D7D0083BF3F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = C410947E19BB2D7D0083BF3F /* Project object */; +} diff --git a/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..595620b --- /dev/null +++ b/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/xcshareddata/telegram-adium.xccheckout b/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/xcshareddata/telegram-adium.xccheckout new file mode 100644 index 0000000..041fe29 --- /dev/null +++ b/telegram-adium/telegram-adium.xcodeproj/project.xcworkspace/xcshareddata/telegram-adium.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 1C5A3335-4726-410A-8E70-801C8879E269 + IDESourceControlProjectName + telegram-adium + IDESourceControlProjectOriginsDictionary + + 2BAF9F6AF710B4D765F611851696219A50533669 + ssh://bitbucket.org/telegrampurple/telegram-purple.git + + IDESourceControlProjectPath + telegram-adium/telegram-adium.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 2BAF9F6AF710B4D765F611851696219A50533669 + ../../.. + + IDESourceControlProjectURL + ssh://bitbucket.org/telegrampurple/telegram-purple.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + 2BAF9F6AF710B4D765F611851696219A50533669 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 2BAF9F6AF710B4D765F611851696219A50533669 + IDESourceControlWCCName + telegram-purple + + + + diff --git a/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/telegram-adium.xcscheme b/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/telegram-adium.xcscheme new file mode 100644 index 0000000..843ae82 --- /dev/null +++ b/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/telegram-adium.xcscheme @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/xcschememanagement.plist b/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6742db5 --- /dev/null +++ b/telegram-adium/telegram-adium.xcodeproj/xcuserdata/matj.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + telegram-adium.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + C410948519BB2D7D0083BF3F + + primary + + + + + diff --git a/telegram-adium/telegram-adium/en.lproj/InfoPlist.strings b/telegram-adium/telegram-adium/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/telegram-adium/telegram-adium/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/telegram-adium/telegram-adium/telegram-adium-Info.plist b/telegram-adium/telegram-adium/telegram-adium-Info.plist new file mode 100644 index 0000000..775c6b7 --- /dev/null +++ b/telegram-adium/telegram-adium/telegram-adium-Info.plist @@ -0,0 +1,50 @@ + + + + + AIMinimumAdiumVersionRequirement + 1.4 + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + org.telegram-purple.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + AdIM + CFBundleVersion + 1 + CFPlugInDynamicRegisterFunction + + CFPlugInDynamicRegistration + NO + CFPlugInFactories + + 00000000-0000-0000-0000-000000000000 + MyFactoryFunction + + CFPlugInTypes + + 00000000-0000-0000-0000-000000000000 + + 00000000-0000-0000-0000-000000000000 + + + CFPlugInUnloadFunction + + NSHumanReadableCopyright + Copyright © 2014 Matthias Jentsch. All rights reserved. + NSPrincipalClass + TelegramPlugin + + diff --git a/telegram-adium/telegram-adium/telegram-adium-Prefix.pch b/telegram-adium/telegram-adium/telegram-adium-Prefix.pch new file mode 100644 index 0000000..6f065c1 --- /dev/null +++ b/telegram-adium/telegram-adium/telegram-adium-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import + #import +#endif + +#ifndef __ADIUM_ + #define __ADIUM_ +#endif \ No newline at end of file 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 736f11e..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 @@ -251,7 +251,7 @@ struct telegram { long long cur_downloading_bytes; long long cur_downloaded_bytes; int our_id; - struct user User; + struct tgl_user User; BN_CTX *ctx; int encr_root; unsigned char *encr_prime; @@ -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