Skip to content

Commit

Permalink
Add flag to mark messages as created by this session
Browse files Browse the repository at this point in the history
Allow clients to distinct between messages send by the current, or
messages send by a different client.
  • Loading branch information
majn committed May 25, 2015
1 parent 67944b1 commit 31cca91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions queries.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,12 +848,12 @@ void tgl_do_send_message (struct tgl_state *TLS, tgl_peer_id_t id, const char *t
struct tl_ds_message_media TDSM;
TDSM.magic = CODE_message_media_empty;

bl_do_create_message_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, NULL, NULL, &date, text, text_len, &TDSM, NULL, reply ? &reply : NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | disable_preview);
bl_do_create_message_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, NULL, NULL, &date, text, text_len, &TDSM, NULL, reply ? &reply : NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_SESSION_OUTBOUND | disable_preview);
} else {
struct tl_ds_decrypted_message_media TDSM;
TDSM.magic = CODE_decrypted_message_media_empty;

bl_do_create_message_encr_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, &date, text, text_len, &TDSM, NULL, NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_ENCRYPTED);
bl_do_create_message_encr_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, &date, text, text_len, &TDSM, NULL, NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_SESSION_OUTBOUND | TGLMF_ENCRYPTED);
}

struct tgl_message *M = tgl_message_get (TLS, t);
Expand Down
1 change: 1 addition & 0 deletions tgl-layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define TGLMF_ENCRYPTED (1 << 11)
#define TGLMF_EMPTY (1 << 12)
#define TGLMF_SERVICE (1 << 13)
#define TGLMF_SESSION_OUTBOUND (1 << 14)

#define TGLMF_CREATE 0x10000

Expand Down

0 comments on commit 31cca91

Please sign in to comment.