Fix coding guidelines
This commit is contained in:
parent
22a37c3894
commit
ef23a1b589
5 changed files with 734 additions and 804 deletions
80
msglog.c
80
msglog.c
|
@ -20,60 +20,54 @@
|
|||
#endif
|
||||
|
||||
void hexdump (int *in_ptr, int *in_end) {
|
||||
// TODO: figure out how to log hexdumps to purple log
|
||||
int *ptr = in_ptr;
|
||||
while (ptr < in_end) {
|
||||
++ ptr;
|
||||
//printf (" %08x", *(ptr ++));
|
||||
}
|
||||
//printf ("\n");
|
||||
// TODO: figure out how to log hexdumps to purple log
|
||||
int *ptr = in_ptr;
|
||||
while (ptr < in_end) {
|
||||
++ ptr;
|
||||
//printf (" %08x", *(ptr ++));
|
||||
}
|
||||
//printf ("\n");
|
||||
}
|
||||
|
||||
void log_level_printf (const char* format, va_list ap, int level, char *color)
|
||||
{
|
||||
char buffer[256];
|
||||
vsnprintf(buffer, sizeof(buffer), format, ap);
|
||||
purple_debug(level, PLUGIN_ID, "%s%s%s ", color, buffer, COLOR_NORMAL);
|
||||
void log_level_printf (const char* format, va_list ap, int level, char *color) {
|
||||
char buffer[256];
|
||||
vsnprintf(buffer, sizeof(buffer), format, ap);
|
||||
purple_debug(level, PLUGIN_ID, "%s%s%s ", color, buffer, COLOR_NORMAL);
|
||||
}
|
||||
|
||||
void debug(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_MISC, COLOR_NORMAL);
|
||||
va_end (ap);
|
||||
void debug(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_MISC, COLOR_NORMAL);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void info(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_INFO, COLOR_GREEN);
|
||||
va_end (ap);
|
||||
void info(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_INFO, COLOR_GREEN);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void warning(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_WARNING, COLOR_YELLOW);
|
||||
va_end (ap);
|
||||
void warning(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_WARNING, COLOR_YELLOW);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void failure(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_ERROR, COLOR_YELLOW);
|
||||
va_end (ap);
|
||||
void failure(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_ERROR, COLOR_YELLOW);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void fatal(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_FATAL, COLOR_REDB);
|
||||
va_end (ap);
|
||||
info ("\n");
|
||||
void fatal(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
log_level_printf (format, ap, PURPLE_DEBUG_FATAL, COLOR_REDB);
|
||||
va_end (ap);
|
||||
info ("\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -275,47 +275,47 @@ static void request_code (struct tgl_state *TLS) {
|
|||
telegram_conn *conn = TLS->ev_base;
|
||||
|
||||
purple_request_input (
|
||||
conn->gc, // handle (the PurpleAccount)
|
||||
"Telegram Code", // title
|
||||
conn->gc, // handle (the PurpleAccount)
|
||||
"Telegram Code", // title
|
||||
"Enter Telegram Code", // primary
|
||||
"Telegram wants to verify your identity, please enter the code, that you have received via SMS.", // secondary
|
||||
NULL, // default_value
|
||||
0, // multiline
|
||||
0, // masked
|
||||
"code", // hint
|
||||
"OK", // ok_text
|
||||
G_CALLBACK(request_code_entered), // ok_cb
|
||||
"Cancel", // cancel_text
|
||||
G_CALLBACK(request_code_canceled), // cancel_cb
|
||||
conn->pa, // account
|
||||
NULL, // who
|
||||
NULL, // conv
|
||||
TLS // user_data
|
||||
NULL, // default_value
|
||||
0, // multiline
|
||||
0, // masked
|
||||
"code", // hint
|
||||
"OK", // ok_text
|
||||
G_CALLBACK(request_code_entered),
|
||||
"Cancel", // cancel_text
|
||||
G_CALLBACK(request_code_canceled),
|
||||
conn->pa, // account
|
||||
NULL, // who
|
||||
NULL, // conv
|
||||
TLS // user_data
|
||||
);
|
||||
}
|
||||
|
||||
static void request_name_and_code (struct tgl_state *TLS) {
|
||||
telegram_conn *conn = TLS->ev_base;
|
||||
telegram_conn *conn = TLS->ev_base;
|
||||
|
||||
debug ("Phone is not registered, registering...\n");
|
||||
debug ("Phone is not registered, registering...\n");
|
||||
|
||||
PurpleRequestFields* fields = purple_request_fields_new();
|
||||
PurpleRequestField* field = 0;
|
||||
PurpleRequestFields* fields = purple_request_fields_new();
|
||||
PurpleRequestField* field = 0;
|
||||
|
||||
PurpleRequestFieldGroup* group = purple_request_field_group_new("Registration");
|
||||
field = purple_request_field_string_new("first_name", "First Name", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
field = purple_request_field_string_new("last_name", "Last Name", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
purple_request_fields_add_group(fields, group);
|
||||
PurpleRequestFieldGroup* group = purple_request_field_group_new("Registration");
|
||||
field = purple_request_field_string_new("first_name", "First Name", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
field = purple_request_field_string_new("last_name", "Last Name", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
purple_request_fields_add_group(fields, group);
|
||||
|
||||
group = purple_request_field_group_new("Authorization");
|
||||
field = purple_request_field_string_new("code", "Telegram Code", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
purple_request_fields_add_group(fields, group);
|
||||
group = purple_request_field_group_new("Authorization");
|
||||
field = purple_request_field_string_new("code", "Telegram Code", "", 0);
|
||||
purple_request_field_group_add_field(group, field);
|
||||
purple_request_fields_add_group(fields, group);
|
||||
|
||||
purple_request_fields(conn->gc, "Register", "Please register your phone number.", NULL, fields, "Ok",
|
||||
G_CALLBACK( request_name_code_entered ), "Cancel", NULL, conn->pa, NULL, NULL, conn->gc);
|
||||
purple_request_fields(conn->gc, "Register", "Please register your phone number.", NULL, fields, "Ok",
|
||||
G_CALLBACK( request_name_code_entered ), "Cancel", NULL, conn->pa, NULL, NULL, conn->gc);
|
||||
}
|
||||
|
||||
static void sign_in_callback (struct tgl_state *TLS, void *extra, int success, int registered, const char *mhash) {
|
||||
|
|
1124
telegram-purple.c
1124
telegram-purple.c
File diff suppressed because it is too large
Load diff
265
tgp-2prpl.c
265
tgp-2prpl.c
|
@ -21,210 +21,211 @@
|
|||
|
||||
#include <server.h>
|
||||
#include <tgl.h>
|
||||
#include <msglog.h>
|
||||
|
||||
static void sanitize_alias(char *buffer) {
|
||||
size_t len = strlen(buffer);
|
||||
gchar *curr;
|
||||
while ((curr = g_utf8_strchr(buffer, len, '\n'))) {
|
||||
*curr = 0x20;
|
||||
}
|
||||
size_t len = strlen(buffer);
|
||||
gchar *curr;
|
||||
while ((curr = g_utf8_strchr(buffer, len, '\n'))) {
|
||||
*curr = 0x20;
|
||||
}
|
||||
}
|
||||
|
||||
static int user_get_alias (tgl_peer_t *user, char *buffer, int maxlen) {
|
||||
char* last_name = (user->user.last_name && strlen(user->user.last_name)) ? user->user.last_name : "";
|
||||
char* first_name = (user->user.first_name && strlen(user->user.first_name)) ? user->user.first_name : "";
|
||||
sanitize_alias (last_name);
|
||||
sanitize_alias (first_name);
|
||||
if (strlen (first_name) && strlen(last_name)) {
|
||||
return snprintf (buffer, maxlen, "%s %s", first_name, last_name);
|
||||
} else if (strlen (first_name)) {
|
||||
return snprintf (buffer, maxlen, "%s", first_name);
|
||||
} else if (strlen (last_name)) {
|
||||
return snprintf (buffer, maxlen, "%s", last_name);
|
||||
} else {
|
||||
return snprintf (buffer, maxlen, "%d", tgl_get_peer_id (user->id));
|
||||
}
|
||||
char* last_name = (user->user.last_name && strlen(user->user.last_name)) ? user->user.last_name : "";
|
||||
char* first_name = (user->user.first_name && strlen(user->user.first_name)) ? user->user.first_name : "";
|
||||
sanitize_alias (last_name);
|
||||
sanitize_alias (first_name);
|
||||
if (strlen (first_name) && strlen(last_name)) {
|
||||
return snprintf (buffer, maxlen, "%s %s", first_name, last_name);
|
||||
} else if (strlen (first_name)) {
|
||||
return snprintf (buffer, maxlen, "%s", first_name);
|
||||
} else if (strlen (last_name)) {
|
||||
return snprintf (buffer, maxlen, "%s", last_name);
|
||||
} else {
|
||||
return snprintf (buffer, maxlen, "%d", tgl_get_peer_id (user->id));
|
||||
}
|
||||
}
|
||||
|
||||
PurpleAccount *tg_get_acc (struct tgl_state *TLS) {
|
||||
return (PurpleAccount *) ((telegram_conn *)TLS->ev_base)->pa;
|
||||
return (PurpleAccount *) ((telegram_conn *)TLS->ev_base)->pa;
|
||||
}
|
||||
|
||||
PurpleConnection *tg_get_conn (struct tgl_state *TLS) {
|
||||
return (PurpleConnection *) ((telegram_conn *)TLS->ev_base)->gc;
|
||||
return (PurpleConnection *) ((telegram_conn *)TLS->ev_base)->gc;
|
||||
}
|
||||
|
||||
static char *peer_strdup_id(tgl_peer_id_t user) {
|
||||
return g_strdup_printf("%d", tgl_get_peer_id(user));
|
||||
return g_strdup_printf("%d", tgl_get_peer_id(user));
|
||||
}
|
||||
|
||||
char *p2tgl_strdup_alias(tgl_peer_t *user) {
|
||||
char *alias = malloc(64);
|
||||
if (user_get_alias(user, alias, 64) < 0) {
|
||||
free (alias);
|
||||
warning ("user name too long");
|
||||
return "!!! name too long";
|
||||
}
|
||||
gchar *g_alias = g_strdup(alias);
|
||||
char *alias = malloc(64);
|
||||
if (user_get_alias(user, alias, 64) < 0) {
|
||||
free (alias);
|
||||
return g_alias;
|
||||
warning ("user name too long");
|
||||
return "!!! name too long";
|
||||
}
|
||||
gchar *g_alias = g_strdup(alias);
|
||||
free (alias);
|
||||
return g_alias;
|
||||
}
|
||||
|
||||
static PurpleChat *blist_find_chat_by_hasht_cond(PurpleConnection *gc,
|
||||
int (*fn)(GHashTable *hasht, void *data), void *data) {
|
||||
PurpleAccount *account = purple_connection_get_account(gc);
|
||||
PurpleBlistNode *node = purple_blist_get_root();
|
||||
GHashTable *hasht;
|
||||
while (node) {
|
||||
if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
|
||||
PurpleChat *ch = PURPLE_CHAT(node);
|
||||
if (purple_chat_get_account(ch) == account) {
|
||||
hasht = purple_chat_get_components(ch);
|
||||
if (fn(hasht, data))
|
||||
return ch;
|
||||
}
|
||||
}
|
||||
node = purple_blist_node_next(node, 0);
|
||||
int (*fn)(GHashTable *hasht, void *data), void *data) {
|
||||
PurpleAccount *account = purple_connection_get_account(gc);
|
||||
PurpleBlistNode *node = purple_blist_get_root();
|
||||
GHashTable *hasht;
|
||||
while (node) {
|
||||
if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
|
||||
PurpleChat *ch = PURPLE_CHAT(node);
|
||||
if (purple_chat_get_account(ch) == account) {
|
||||
hasht = purple_chat_get_components(ch);
|
||||
if (fn(hasht, data))
|
||||
return ch;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
node = purple_blist_node_next(node, 0);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int hasht_cmp_id(GHashTable *hasht, void *data) {
|
||||
return !strcmp(g_hash_table_lookup(hasht, "id"), *((char **)data));
|
||||
return !strcmp(g_hash_table_lookup(hasht, "id"), *((char **)data));
|
||||
}
|
||||
|
||||
|
||||
PurpleConversation *p2tgl_got_joined_chat (struct tgl_state *TLS, struct tgl_chat *chat) {
|
||||
telegram_conn *conn = TLS->ev_base;
|
||||
gchar *alias = p2tgl_strdup_alias(chat);
|
||||
|
||||
PurpleConversation *conv = serv_got_joined_chat(conn->gc, tgl_get_peer_id(chat->id), alias);
|
||||
|
||||
g_free(alias);
|
||||
return conv;
|
||||
telegram_conn *conn = TLS->ev_base;
|
||||
gchar *alias = p2tgl_strdup_alias(chat);
|
||||
|
||||
PurpleConversation *conv = serv_got_joined_chat(conn->gc, tgl_get_peer_id(chat->id), alias);
|
||||
|
||||
g_free(alias);
|
||||
return conv;
|
||||
}
|
||||
|
||||
void p2tgl_got_chat_left (struct tgl_state *TLS, tgl_peer_id_t chat) {
|
||||
serv_got_chat_left(tg_get_conn(TLS), tgl_get_peer_id(chat));
|
||||
serv_got_chat_left(tg_get_conn(TLS), tgl_get_peer_id(chat));
|
||||
}
|
||||
|
||||
void p2tgl_got_chat_in (struct tgl_state *TLS, tgl_peer_id_t chat, tgl_peer_id_t who, const char *message, int flags, time_t when) {
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_chat_in(tg_get_conn(TLS), chat.id, name, flags, message, when);
|
||||
|
||||
g_free (name);
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_chat_in(tg_get_conn(TLS), chat.id, name, flags, message, when);
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
void p2tgl_got_alias (struct tgl_state *TLS, tgl_peer_id_t who, const char *alias) {
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_alias(tg_get_conn(TLS), name, alias);
|
||||
|
||||
g_free (name);
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_alias(tg_get_conn(TLS), name, alias);
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
void p2tgl_got_im (struct tgl_state *TLS, tgl_peer_id_t who, const char *msg, int flags, time_t when) {
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_im(tg_get_conn(TLS), name, msg,flags, when);
|
||||
|
||||
g_free (name);
|
||||
char *name = peer_strdup_id(who);
|
||||
|
||||
serv_got_im(tg_get_conn(TLS), name, msg,flags, when);
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
void p2tgl_got_typing (struct tgl_state *TLS, tgl_peer_id_t user, int timeout) {
|
||||
char *who = g_strdup_printf("%d", tgl_get_peer_id(user));
|
||||
|
||||
serv_got_typing(tg_get_conn(TLS), who, timeout, PURPLE_TYPING);
|
||||
|
||||
g_free(who);
|
||||
char *who = g_strdup_printf("%d", tgl_get_peer_id(user));
|
||||
|
||||
serv_got_typing(tg_get_conn(TLS), who, timeout, PURPLE_TYPING);
|
||||
|
||||
g_free(who);
|
||||
}
|
||||
|
||||
|
||||
PurpleBuddy *p2tgl_buddy_find (struct tgl_state *TLS, tgl_peer_id_t user) {
|
||||
gchar *name = peer_strdup_id(user);
|
||||
|
||||
PurpleBuddy *b = purple_find_buddy (tg_get_acc(TLS), name);
|
||||
|
||||
g_free (name);
|
||||
return b;
|
||||
gchar *name = peer_strdup_id(user);
|
||||
|
||||
PurpleBuddy *b = purple_find_buddy (tg_get_acc(TLS), name);
|
||||
|
||||
g_free (name);
|
||||
return b;
|
||||
}
|
||||
|
||||
PurpleBuddy *p2tgl_buddy_new (struct tgl_state *TLS, tgl_peer_t *user) {
|
||||
char *alias = p2tgl_strdup_alias (user);
|
||||
char *name = peer_strdup_id (user->id);
|
||||
|
||||
PurpleBuddy *b = purple_buddy_new(tg_get_acc(TLS), name, alias);
|
||||
|
||||
g_free (alias);
|
||||
g_free (name);
|
||||
return b;
|
||||
char *alias = p2tgl_strdup_alias (user);
|
||||
char *name = peer_strdup_id (user->id);
|
||||
|
||||
PurpleBuddy *b = purple_buddy_new(tg_get_acc(TLS), name, alias);
|
||||
|
||||
g_free (alias);
|
||||
g_free (name);
|
||||
return b;
|
||||
}
|
||||
|
||||
void p2tgl_prpl_got_user_status (struct tgl_state *TLS, tgl_peer_id_t user, struct tgl_user_status *status) {
|
||||
|
||||
const char *state = status->online == 1 ? "available" : "mobile";
|
||||
char *name = peer_strdup_id (user);
|
||||
char *when = g_strdup_printf("%d", status->when);
|
||||
|
||||
purple_prpl_got_user_status (tg_get_acc(TLS), name, state, "last online", when, NULL);
|
||||
|
||||
g_free(name);
|
||||
g_free(when);
|
||||
|
||||
const char *state = status->online == 1 ? "available" : "mobile";
|
||||
char *name = peer_strdup_id (user);
|
||||
char *when = g_strdup_printf("%d", status->when);
|
||||
|
||||
purple_prpl_got_user_status (tg_get_acc(TLS), name, state, "last online", when, NULL);
|
||||
|
||||
g_free(name);
|
||||
g_free(when);
|
||||
}
|
||||
|
||||
PurpleChat *p2tgl_blist_find_chat(struct tgl_state *TLS, tgl_peer_id_t chat) {
|
||||
char *name = peer_strdup_id(chat);
|
||||
|
||||
PurpleChat *c = purple_blist_find_chat(tg_get_acc(TLS), name);
|
||||
|
||||
g_free (name);
|
||||
return c;
|
||||
char *name = peer_strdup_id(chat);
|
||||
|
||||
PurpleChat *c = purple_blist_find_chat(tg_get_acc(TLS), name);
|
||||
|
||||
g_free (name);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
PurpleChat *p2tgl_chat_new (struct tgl_state *TLS, struct tgl_chat *chat) {
|
||||
gchar *admin = g_strdup_printf("%d", chat->admin_id);
|
||||
gchar *title = g_strdup(chat->title);
|
||||
gchar *name = peer_strdup_id (chat->id);
|
||||
|
||||
GHashTable *ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
|
||||
g_hash_table_insert(ht, g_strdup("subject"), title);
|
||||
g_hash_table_insert(ht, g_strdup("id"), name);
|
||||
g_hash_table_insert(ht, g_strdup("owner"), admin);
|
||||
|
||||
return purple_chat_new(tg_get_acc(TLS), chat->title, ht);
|
||||
gchar *admin = g_strdup_printf("%d", chat->admin_id);
|
||||
gchar *title = g_strdup(chat->title);
|
||||
gchar *name = peer_strdup_id (chat->id);
|
||||
|
||||
GHashTable *ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
|
||||
g_hash_table_insert(ht, g_strdup("subject"), title);
|
||||
g_hash_table_insert(ht, g_strdup("id"), name);
|
||||
g_hash_table_insert(ht, g_strdup("owner"), admin);
|
||||
|
||||
return purple_chat_new(tg_get_acc(TLS), chat->title, ht);
|
||||
}
|
||||
|
||||
PurpleChat *p2tgl_chat_find (struct tgl_state *TLS, tgl_peer_id_t id) {
|
||||
char *name = peer_strdup_id(id);
|
||||
PurpleChat *c = blist_find_chat_by_hasht_cond(tg_get_conn(TLS), hasht_cmp_id, &name);
|
||||
g_free(name);
|
||||
return c;
|
||||
char *name = peer_strdup_id(id);
|
||||
PurpleChat *c = blist_find_chat_by_hasht_cond(tg_get_conn(TLS), hasht_cmp_id, &name);
|
||||
g_free(name);
|
||||
return c;
|
||||
}
|
||||
|
||||
void p2tgl_conv_add_user (PurpleConversation *conv, struct tgl_chat_user user, char *message, int flags, int new_arrival) {
|
||||
PurpleConvChat *cdata = purple_conversation_get_chat_data(conv);
|
||||
char *name = g_strdup_printf("%d", user.user_id);
|
||||
|
||||
purple_conv_chat_add_user(cdata, name, message, flags, new_arrival);
|
||||
|
||||
g_free(name);
|
||||
PurpleConvChat *cdata = purple_conversation_get_chat_data(conv);
|
||||
char *name = g_strdup_printf("%d", user.user_id);
|
||||
|
||||
purple_conv_chat_add_user(cdata, name, message, flags, new_arrival);
|
||||
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
void p2tgl_connection_set_display_name(struct tgl_state *TLS, tgl_peer_t *user) {
|
||||
char *name = p2tgl_strdup_alias(user);
|
||||
purple_connection_set_display_name(tg_get_conn(TLS), name);
|
||||
g_free(name);
|
||||
char *name = p2tgl_strdup_alias(user);
|
||||
purple_connection_set_display_name(tg_get_conn(TLS), name);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
|
||||
void *p2tgl_notify_userinfo(struct tgl_state *TLS, tgl_peer_id_t user, PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb, gpointer user_data) {
|
||||
char *name = peer_strdup_id(user);
|
||||
void *handle = 0;
|
||||
|
||||
handle = purple_notify_userinfo(tg_get_conn(TLS), name, user_info, cb, user_data);
|
||||
|
||||
g_free(name);
|
||||
return handle;
|
||||
char *name = peer_strdup_id(user);
|
||||
void *handle = 0;
|
||||
|
||||
handle = purple_notify_userinfo(tg_get_conn(TLS), name, user_info, cb, user_data);
|
||||
|
||||
g_free(name);
|
||||
return handle;
|
||||
}
|
||||
|
|
|
@ -42,18 +42,13 @@
|
|||
#include <time.h>
|
||||
|
||||
#include "tgp-net.h"
|
||||
//#include "include.h"
|
||||
#include <tgl.h>
|
||||
#include <tgl-inner.h>
|
||||
//#include "mtproto-client.h"
|
||||
//#include "mtproto-common.h"
|
||||
//#include "tree.h"
|
||||
//#include "tools.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <eventloop.h>
|
||||
|
||||
#include "telegram-purple.h"
|
||||
#include <telegram-purple.h>
|
||||
#include <msglog.h>
|
||||
|
||||
#ifndef POLLRDHUP
|
||||
#define POLLRDHUP 0
|
||||
|
|
Loading…
Add table
Reference in a new issue