Commit 969da088 authored by vvaltman's avatar vvaltman

Merge branch 'master' of adm239:tg

Conflicts:
	interface.c
	tgl.h
parents f58b812b d1096cba
This diff is collapsed.
......@@ -680,7 +680,7 @@ void interpreter_chat_mode (char *line) {
tgl_do_mark_read (chat_mode_id, 0, 0);
return;
}
if (strlen (line)>0) {
if (strlen (line) > 0) {
tgl_do_send_message (chat_mode_id, line, strlen (line), 0, 0);
}
}
......@@ -736,11 +736,9 @@ struct tgl_update_callback upd_cb = {
.user_registered = 0,
.user_activated = 0,
.new_authorization = 0,
.secret_chat_created = 0,
.secret_chat_request = 0,
.secret_chat_established = 0,
.secret_chat_deleted = 0,
.secret_chat_accepted = 0,
.user_update = 0,
.chat_update = 0,
.secret_chat_update = 0,
.msg_receive = print_message_gw
};
......
......@@ -237,7 +237,7 @@ int tglf_fetch_user (struct tgl_user *U) {
if (x == CODE_user_contact) {
bl_do_user_set_friend (U, 1);
} else {
} else {
bl_do_user_set_friend (U, 0);
}
}
......
......@@ -14,6 +14,22 @@ struct connection;
struct mtproto_methods;
struct session;
struct dc;
#define TGL_UPDATE_CREATED 1
#define TGL_UPDATE_DELETED 2
#define TGL_UPDATE_PHONE 4
#define TGL_UPDATE_CONTACT 8
#define TGL_UPDATE_PHOTO 16
#define TGL_UPDATE_BLOCKED 32
#define TGL_UPDATE_REAL_NAME 64
#define TGL_UPDATE_NAME 128
#define TGL_UPDATE_REQUESTED 256
#define TGL_UPDATE_WORKING 512
#define TGL_UPDATE_FLAGS 1024
#define TGL_UPDATE_TITLE 2048
#define TGL_UPDATE_ADMIN 4096
#define TGL_UPDATE_MEMBERS 8192
struct tgl_update_callback {
void (*new_msg)(struct tgl_message *M);
void (*marked_read)(int num, struct tgl_message *list[]);
......@@ -25,20 +41,21 @@ struct tgl_update_callback {
void (*user_registered)(struct tgl_user *U);
void (*user_activated)(struct tgl_user *U);
void (*new_authorization)(const char *device, const char *location);
void (*secret_chat_created)(struct tgl_secret_chat *E);
void (*secret_chat_request)(struct tgl_secret_chat *E);
void (*secret_chat_established)(struct tgl_secret_chat *E);
void (*secret_chat_deleted)(struct tgl_secret_chat *E);
void (*secret_chat_accepted)(struct tgl_secret_chat *E);
void (*new_user)(struct tgl_user *U);
void (*delete_user)(struct tgl_user *U);
void (*update_user_info)(struct tgl_user *U);
//void (*secret_chat_created)(struct tgl_secret_chat *E);
//void (*secret_chat_request)(struct tgl_secret_chat *E);
//void (*secret_chat_established)(struct tgl_secret_chat *E);
//void (*secret_chat_deleted)(struct tgl_secret_chat *E);
//void (*secret_chat_accepted)(struct tgl_secret_chat *E);
//void (*new_user)(struct tgl_user *U);
//void (*delete_user)(struct tgl_user *U);
//void (*update_user_info)(struct tgl_user *U);
//void (*secret_chat_delete)(struct tgl_secret_chat *U);
//void (*secret_chat_requested)(struct tgl_secret_chat *U);
//void (*secret_chat_accepted)(struct tgl_secret_chat *U);
//void (*secret_chat_created)(struct tgl_secret_chat *U);
void (*chat_created)(struct tgl_chat *C);
void (*chat_update)(struct tgl_chat *C);
void (*chat_update)(struct tgl_chat *C, unsigned flags);
void (*user_update)(struct tgl_user *C, unsigned flags);
void (*secret_chat_update)(struct tgl_secret_chat *C, unsigned flags);
void (*msg_receive)(struct tgl_message *M);
};
......
......@@ -488,8 +488,8 @@ void tglu_work_update (struct connection *c, long long msg_id) {
pop_color ();
print_end ();*/
if (E->state == sc_request) {
if (tgl_state.callback.secret_chat_request) {
/*if (E->state == sc_request) {
if (tgl_state.callback.secret_chat_update) {
tgl_state.callback.secret_chat_request (E);
}
} else if (E->state == sc_ok) {
......@@ -500,7 +500,7 @@ void tglu_work_update (struct connection *c, long long msg_id) {
if (tgl_state.callback.secret_chat_deleted) {
tgl_state.callback.secret_chat_deleted (E);
}
}
}*/
if (E->state == sc_ok) {
tgl_do_send_encr_chat_layer (E);
}
......@@ -753,6 +753,6 @@ void tglu_work_update_short_chat_message (struct connection *c, long long msg_id
void tglu_work_updates_to_long (struct connection *c, long long msg_id) {
assert (fetch_int () == (int)CODE_updates_too_long);
vlogprintf (E_NOTICE, "updates to long... Getting difference\n");
vlogprintf (E_NOTICE, "updates too long... Getting difference\n");
tgl_do_get_difference (0, 0, 0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment