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
d15b20d4
Commit
d15b20d4
authored
Sep 30, 2015
by
V V
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
8fe86794
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
242 additions
and
100 deletions
+242
-100
interface.c
interface.c
+226
-91
loop.c
loop.c
+7
-6
lua-tg.c
lua-tg.c
+8
-2
tgl
tgl
+1
-1
No files found.
interface.c
View file @
d15b20d4
This diff is collapsed.
Click to expand it.
loop.c
View file @
d15b20d4
...
...
@@ -70,6 +70,7 @@
#include <tgl/tgl-binlog.h>
#include <tgl/tgl-net.h>
#include <tgl/tgl-timers.h>
#include <tgl/tgl-queries.h>
#include <openssl/sha.h>
...
...
@@ -349,13 +350,13 @@ void net_loop (void) {
write_state_file
();
update_prompt
();
if
(
unknown_user_list_pos
)
{
/*
if (unknown_user_list_pos) {
int i;
for (i = 0; i < unknown_user_list_pos; i++) {
tgl_do_get_user_info (TLS, TGL_MK_USER (unknown_user_list[i]), 0, 0, 0);
}
unknown_user_list_pos = 0;
}
}
*/
}
if
(
term_ev
)
{
...
...
@@ -484,7 +485,7 @@ void write_auth_file (void) {
tgl_dc_iterator_ex
(
TLS
,
write_dc
,
&
auth_file_fd
);
assert
(
write
(
auth_file_fd
,
&
TLS
->
our_id
,
4
)
==
4
);
assert
(
write
(
auth_file_fd
,
&
TLS
->
our_id
.
peer_id
,
4
)
==
4
);
close
(
auth_file_fd
);
}
...
...
@@ -611,7 +612,7 @@ void read_auth_file (void) {
assert
(
!
l
);
}
if
(
our_id
)
{
bl_do_set_our_id
(
TLS
,
our_id
);
bl_do_set_our_id
(
TLS
,
TGL_MK_USER
(
our_id
)
);
}
close
(
auth_file_fd
);
}
...
...
@@ -759,7 +760,7 @@ void on_login (struct tgl_state *TLS) {
}
void
on_started
(
struct
tgl_state
*
TLS
);
void
dlist_cb
(
struct
tgl_state
*
TLSR
,
void
*
callback_extra
,
int
success
,
int
size
,
tgl_peer_id_t
peers
[],
int
last_msg_id
[],
int
unread_count
[])
{
void
dlist_cb
(
struct
tgl_state
*
TLSR
,
void
*
callback_extra
,
int
success
,
int
size
,
tgl_peer_id_t
peers
[],
tgl_message_id_t
*
last_msg_id
[],
int
unread_count
[])
{
on_started
(
TLS
);
}
...
...
@@ -850,7 +851,7 @@ int loop (void) {
update_prompt
();
if
(
reset_authorization
)
{
tgl_peer_t
*
P
=
tgl_peer_get
(
TLS
,
T
GL_MK_USER
(
TLS
->
our_id
)
);
tgl_peer_t
*
P
=
tgl_peer_get
(
TLS
,
T
LS
->
our_id
);
if
(
P
&&
P
->
user
.
phone
&&
reset_authorization
==
1
)
{
set_default_username
(
P
->
user
.
phone
);
}
...
...
lua-tg.c
View file @
d15b20d4
...
...
@@ -431,8 +431,14 @@ void push_message (struct tgl_message *M) {
my_lua_checkstack
(
luaState
,
10
);
lua_newtable
(
luaState
);
static
char
s
[
30
];
snprintf
(
s
,
30
,
"%lld"
,
M
->
id
);
static
char
s
[
256
];
unsigned
char
*
mid
=
(
void
*
)
&
M
->
permanent_id
;
int
i
;
for
(
i
=
0
;
i
<
(
int
)
sizeof
(
struct
tgl_message_permanent_id
);
i
++
)
{
sprintf
(
s
+
2
*
i
,
"%02u"
,
(
unsigned
)
mid
[
i
]);
}
lua_add_string_field
(
"id"
,
s
);
if
(
!
(
M
->
flags
&
TGLMF_CREATED
))
{
return
;
}
lua_add_num_field
(
"flags"
,
M
->
flags
);
...
...
tgl
@
23ff689b
Subproject commit
1cdaac625b8af7312b909d8cbb655ec2807543c5
Subproject commit
23ff689b27ba19f8beb37467ce00c9e062d9e688
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