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
57cff060
Commit
57cff060
authored
Feb 03, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added -W key to wait dialog list before processing input
parent
051a64fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
loop.c
loop.c
+11
-1
main.c
main.c
+5
-1
queries.c
queries.c
+3
-0
No files found.
loop.c
View file @
57cff060
...
@@ -326,6 +326,7 @@ extern int peer_num;
...
@@ -326,6 +326,7 @@ extern int peer_num;
extern
int
encr_root
;
extern
int
encr_root
;
extern
unsigned
char
*
encr_prime
;
extern
unsigned
char
*
encr_prime
;
extern
int
encr_param_version
;
extern
int
encr_param_version
;
extern
int
dialog_list_got
;
void
read_secret_chat_file
(
void
)
{
void
read_secret_chat_file
(
void
)
{
if
(
binlog_enabled
)
{
return
;
}
if
(
binlog_enabled
)
{
return
;
}
...
@@ -443,11 +444,16 @@ int mcs (void) {
...
@@ -443,11 +444,16 @@ int mcs (void) {
extern
int
difference_got
;
extern
int
difference_got
;
int
dgot
(
void
)
{
int
dgot
(
void
)
{
return
!
difference_got
;
return
difference_got
;
}
int
dlgot
(
void
)
{
return
dialog_list_got
;
}
}
int
readline_active
;
int
readline_active
;
int
new_dc_num
;
int
new_dc_num
;
int
wait_dialog_list
;
int
loop
(
void
)
{
int
loop
(
void
)
{
on_start
();
on_start
();
if
(
binlog_enabled
)
{
if
(
binlog_enabled
)
{
...
@@ -598,6 +604,10 @@ int loop (void) {
...
@@ -598,6 +604,10 @@ int loop (void) {
do_get_dialog_list
();
do_get_dialog_list
();
if
(
wait_dialog_list
)
{
dialog_list_got
=
0
;
net_loop
(
0
,
dlgot
);
}
return
main_loop
();
return
main_loop
();
}
}
...
...
main.c
View file @
57cff060
...
@@ -358,12 +358,13 @@ FILE *log_net_f;
...
@@ -358,12 +358,13 @@ FILE *log_net_f;
int
register_mode
;
int
register_mode
;
int
disable_auto_accept
;
int
disable_auto_accept
;
int
wait_dialog_list
;
char
*
lua_file
;
char
*
lua_file
;
void
args_parse
(
int
argc
,
char
**
argv
)
{
void
args_parse
(
int
argc
,
char
**
argv
)
{
int
opt
=
0
;
int
opt
=
0
;
while
((
opt
=
getopt
(
argc
,
argv
,
"u:hk:vn:Nc:p:l:RfBL:Es:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"u:hk:vn:Nc:p:l:RfBL:Es:
wW
"
))
!=
-
1
)
{
switch
(
opt
)
{
switch
(
opt
)
{
case
'u'
:
case
'u'
:
set_default_username
(
optarg
);
set_default_username
(
optarg
);
...
@@ -413,6 +414,9 @@ void args_parse (int argc, char **argv) {
...
@@ -413,6 +414,9 @@ void args_parse (int argc, char **argv) {
case
's'
:
case
's'
:
lua_file
=
tstrdup
(
optarg
);
lua_file
=
tstrdup
(
optarg
);
break
;
break
;
case
'W'
:
wait_dialog_list
=
1
;
break
;
case
'h'
:
case
'h'
:
default:
default:
usage
();
usage
();
...
...
queries.c
View file @
57cff060
...
@@ -1087,6 +1087,7 @@ void do_get_history (peer_id_t id, int limit) {
...
@@ -1087,6 +1087,7 @@ void do_get_history (peer_id_t id, int limit) {
/* }}} */
/* }}} */
/* {{{ Get dialogs */
/* {{{ Get dialogs */
int
dialog_list_got
;
int
get_dialogs_on_answer
(
struct
query
*
q
UU
)
{
int
get_dialogs_on_answer
(
struct
query
*
q
UU
)
{
unsigned
x
=
fetch_int
();
unsigned
x
=
fetch_int
();
assert
(
x
==
CODE_messages_dialogs
||
x
==
CODE_messages_dialogs_slice
);
assert
(
x
==
CODE_messages_dialogs
||
x
==
CODE_messages_dialogs_slice
);
...
@@ -1147,6 +1148,8 @@ int get_dialogs_on_answer (struct query *q UU) {
...
@@ -1147,6 +1148,8 @@ int get_dialogs_on_answer (struct query *q UU) {
}
}
pop_color
();
pop_color
();
print_end
();
print_end
();
dialog_list_got
=
1
;
return
0
;
return
0
;
}
}
...
...
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