Commit d1096cba authored by Vysheng's avatar Vysheng

fixes

parent 2b2cc686
This diff is collapsed.
...@@ -736,11 +736,9 @@ struct tgl_update_callback upd_cb = { ...@@ -736,11 +736,9 @@ struct tgl_update_callback upd_cb = {
.user_registered = 0, .user_registered = 0,
.user_activated = 0, .user_activated = 0,
.new_authorization = 0, .new_authorization = 0,
.secret_chat_created = 0, .user_update = 0,
.secret_chat_request = 0, .chat_update = 0,
.secret_chat_established = 0, .secret_chat_update = 0
.secret_chat_deleted = 0,
.secret_chat_accepted = 0
}; };
......
...@@ -237,7 +237,7 @@ int tglf_fetch_user (struct tgl_user *U) { ...@@ -237,7 +237,7 @@ int tglf_fetch_user (struct tgl_user *U) {
if (x == CODE_user_contact) { if (x == CODE_user_contact) {
bl_do_user_set_friend (U, 1); bl_do_user_set_friend (U, 1);
} else { } else {
bl_do_user_set_friend (U, 0); bl_do_user_set_friend (U, 0);
} }
} }
......
...@@ -14,6 +14,22 @@ struct connection; ...@@ -14,6 +14,22 @@ struct connection;
struct mtproto_methods; struct mtproto_methods;
struct session; struct session;
struct dc; 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 { struct tgl_update_callback {
void (*new_msg)(struct tgl_message *M); void (*new_msg)(struct tgl_message *M);
void (*marked_read)(int num, struct tgl_message *list[]); void (*marked_read)(int num, struct tgl_message *list[]);
...@@ -25,20 +41,23 @@ struct tgl_update_callback { ...@@ -25,20 +41,23 @@ struct tgl_update_callback {
void (*user_registered)(struct tgl_user *U); void (*user_registered)(struct tgl_user *U);
void (*user_activated)(struct tgl_user *U); void (*user_activated)(struct tgl_user *U);
void (*new_authorization)(const char *device, const char *location); void (*new_authorization)(const char *device, const char *location);
void (*secret_chat_created)(struct tgl_secret_chat *E); //void (*secret_chat_created)(struct tgl_secret_chat *E);
void (*secret_chat_request)(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_established)(struct tgl_secret_chat *E);
void (*secret_chat_deleted)(struct tgl_secret_chat *E); //void (*secret_chat_deleted)(struct tgl_secret_chat *E);
void (*secret_chat_accepted)(struct tgl_secret_chat *E); //void (*secret_chat_accepted)(struct tgl_secret_chat *E);
void (*new_user)(struct tgl_user *U); //void (*new_user)(struct tgl_user *U);
void (*delete_user)(struct tgl_user *U); //void (*delete_user)(struct tgl_user *U);
void (*update_user_info)(struct tgl_user *U); //void (*update_user_info)(struct tgl_user *U);
//void (*secret_chat_delete)(struct tgl_secret_chat *U); //void (*secret_chat_delete)(struct tgl_secret_chat *U);
//void (*secret_chat_requested)(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_accepted)(struct tgl_secret_chat *U);
//void (*secret_chat_created)(struct tgl_secret_chat *U); //void (*secret_chat_created)(struct tgl_secret_chat *U);
void (*chat_created)(struct tgl_chat *C); //void (*chat_created)(struct tgl_chat *C);
void (*chat_update)(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);
}; };
struct tgl_net_methods { struct tgl_net_methods {
......
...@@ -488,8 +488,8 @@ void tglu_work_update (struct connection *c, long long msg_id) { ...@@ -488,8 +488,8 @@ void tglu_work_update (struct connection *c, long long msg_id) {
pop_color (); pop_color ();
print_end ();*/ print_end ();*/
if (E->state == sc_request) { /*if (E->state == sc_request) {
if (tgl_state.callback.secret_chat_request) { if (tgl_state.callback.secret_chat_update) {
tgl_state.callback.secret_chat_request (E); tgl_state.callback.secret_chat_request (E);
} }
} else if (E->state == sc_ok) { } else if (E->state == sc_ok) {
...@@ -500,7 +500,7 @@ void tglu_work_update (struct connection *c, long long msg_id) { ...@@ -500,7 +500,7 @@ void tglu_work_update (struct connection *c, long long msg_id) {
if (tgl_state.callback.secret_chat_deleted) { if (tgl_state.callback.secret_chat_deleted) {
tgl_state.callback.secret_chat_deleted (E); tgl_state.callback.secret_chat_deleted (E);
} }
} }*/
if (E->state == sc_ok) { if (E->state == sc_ok) {
tgl_do_send_encr_chat_layer (E); tgl_do_send_encr_chat_layer (E);
} }
...@@ -724,6 +724,6 @@ void tglu_work_update_short_chat_message (struct connection *c, long long msg_id ...@@ -724,6 +724,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) { void tglu_work_updates_to_long (struct connection *c, long long msg_id) {
assert (fetch_int () == (int)CODE_updates_too_long); 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); 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