Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
56f002a1
Commit
56f002a1
authored
Nov 10, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Plain Diff
Merge github.com:vysheng/tg
parents
824804be
31bd1749
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
event-old.h
event-old.h
+5
-0
interface.c
interface.c
+7
-4
structures.c
structures.c
+5
-1
tgl.h
tgl.h
+1
-1
No files found.
event-old.h
View file @
56f002a1
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define __EVENT_OLD_H__
#define __EVENT_OLD_H__
#include <assert.h>
#include <assert.h>
#include <stdlib.h>
#define BEV_EVENT_READ EVBUFFER_READ
#define BEV_EVENT_READ EVBUFFER_READ
#define BEV_EVENT_WRITE EVBUFFER_WRITE
#define BEV_EVENT_WRITE EVBUFFER_WRITE
...
@@ -40,4 +41,8 @@ static struct bufferevent *bufferevent_socket_new (struct event_base *base, int
...
@@ -40,4 +41,8 @@ static struct bufferevent *bufferevent_socket_new (struct event_base *base, int
bufferevent_base_set
(
base
,
bev
);
bufferevent_base_set
(
base
,
bev
);
return
bev
;
return
bev
;
}
}
static
inline
void
*
event_get_callback_arg
(
const
struct
event
*
ev
)
{
return
ev
->
ev_arg
;
}
#endif
#endif
interface.c
View file @
56f002a1
...
@@ -1272,6 +1272,9 @@ int complete_string_list (char **list, int index, const char *text, int len, cha
...
@@ -1272,6 +1272,9 @@ int complete_string_list (char **list, int index, const char *text, int len, cha
return
-
1
;
return
-
1
;
}
}
}
}
void
print_msg_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_message
*
M
);
void
print_encr_chat_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_secret_chat
*
E
);;
void
print_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
);
int
complete_command_list
(
int
index
,
const
char
*
text
,
int
len
,
char
**
R
)
{
int
complete_command_list
(
int
index
,
const
char
*
text
,
int
len
,
char
**
R
)
{
index
++
;
index
++
;
...
@@ -1279,9 +1282,6 @@ int complete_command_list (int index, const char *text, int len, char **R) {
...
@@ -1279,9 +1282,6 @@ int complete_command_list (int index, const char *text, int len, char **R) {
index
++
;
index
++
;
}
}
if
(
commands
[
index
].
name
)
{
if
(
commands
[
index
].
name
)
{
void
print_msg_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_message
*
M
);
void
print_encr_chat_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_secret_chat
*
E
);;
void
print_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
);
*
R
=
strdup
(
commands
[
index
].
name
);
*
R
=
strdup
(
commands
[
index
].
name
);
assert
(
*
R
);
assert
(
*
R
);
return
index
;
return
index
;
...
@@ -1413,10 +1413,12 @@ void print_success_gw (struct tgl_state *TLSR, void *extra, int success) {
...
@@ -1413,10 +1413,12 @@ void print_success_gw (struct tgl_state *TLSR, void *extra, int success) {
}
}
void
print_msg_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_message
*
M
)
{
void
print_msg_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_message
*
M
)
{
write_secret_chat_file
();
print_success_gw
(
TLS
,
extra
,
success
);
print_success_gw
(
TLS
,
extra
,
success
);
}
}
void
print_encr_chat_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_secret_chat
*
E
)
{
void
print_encr_chat_success_gw
(
struct
tgl_state
*
TLS
,
void
*
extra
,
int
success
,
struct
tgl_secret_chat
*
E
)
{
write_secret_chat_file
();
print_success_gw
(
TLS
,
extra
,
success
);
print_success_gw
(
TLS
,
extra
,
success
);
}
}
...
@@ -1950,7 +1952,8 @@ void secret_chat_update_gw (struct tgl_state *TLSR, struct tgl_secret_chat *U, u
...
@@ -1950,7 +1952,8 @@ void secret_chat_update_gw (struct tgl_state *TLSR, struct tgl_secret_chat *U, u
if
(
!
binlog_read
)
{
return
;
}
if
(
!
binlog_read
)
{
return
;
}
if
((
flags
&
TGL_UPDATE_REQUESTED
)
&&
!
disable_auto_accept
)
{
if
((
flags
&
TGL_UPDATE_REQUESTED
)
&&
!
disable_auto_accept
)
{
tgl_do_accept_encr_chat_request
(
TLS
,
U
,
0
,
0
);
//tgl_do_accept_encr_chat_request (TLS, U, 0, 0);
tgl_do_accept_encr_chat_request
(
TLS
,
U
,
print_encr_chat_success_gw
,
0
);
}
}
if
(
disable_output
&&
!
notify_ev
)
{
return
;
}
if
(
disable_output
&&
!
notify_ev
)
{
return
;
}
...
...
structures.c
View file @
56f002a1
...
@@ -1247,8 +1247,12 @@ void tglf_fetch_encrypted_message (struct tgl_state *TLS, struct tgl_message *M)
...
@@ -1247,8 +1247,12 @@ void tglf_fetch_encrypted_message (struct tgl_state *TLS, struct tgl_message *M)
//vlogprintf (E_WARNING, "in = %d, out = %d\n", in_seq_no, out_seq_no);
//vlogprintf (E_WARNING, "in = %d, out = %d\n", in_seq_no, out_seq_no);
//P->encr_chat.in_seq_no = in_seq_no / 2;
//P->encr_chat.in_seq_no = in_seq_no / 2;
x
=
fetch_int
();
x
=
fetch_int
();
vlogprintf
(
E_DEBUG
-
2
,
"layer = %d, in = %d, out = %d
\n
"
,
layer
,
in_seq_no
,
out_seq_no
);
}
}
if
(
!
(
x
==
CODE_decrypted_message
||
x
==
CODE_decrypted_message_service
||
x
==
CODE_decrypted_message_l16
||
x
==
CODE_decrypted_message_service_l16
))
{
vlogprintf
(
E_ERROR
,
"x = 0x%08x
\n
"
,
x
);
assert
(
x
==
CODE_decrypted_message
||
x
==
CODE_decrypted_message_service
||
x
==
CODE_decrypted_message_l16
||
x
==
CODE_decrypted_message_service_l16
);
assert
(
x
==
CODE_decrypted_message
||
x
==
CODE_decrypted_message_service
||
x
==
CODE_decrypted_message_l16
||
x
==
CODE_decrypted_message_service_l16
);
}
//assert (id == fetch_long ());
//assert (id == fetch_long ());
long
long
new_id
=
fetch_long
();
long
long
new_id
=
fetch_long
();
if
(
P
&&
P
->
encr_chat
.
layer
>=
17
)
{
if
(
P
&&
P
->
encr_chat
.
layer
>=
17
)
{
...
...
tgl.h
View file @
56f002a1
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
#define TGL_BUILD "2590"
#define TGL_BUILD "2590"
#define TGL_VERSION "1.1.0"
#define TGL_VERSION "1.1.0"
#define TGL_ENCRYPTED_LAYER 1
8
#define TGL_ENCRYPTED_LAYER 1
7
struct
connection
;
struct
connection
;
struct
mtproto_methods
;
struct
mtproto_methods
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment