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
33ac1a7e
Commit
33ac1a7e
authored
Sep 11, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problems with send_msg on start
parent
80d35a2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
queries.c
queries.c
+13
-5
No files found.
queries.c
View file @
33ac1a7e
...
...
@@ -841,8 +841,10 @@ static int msg_send_on_answer (struct query *q UU) {
unsigned
x
=
fetch_int
();
assert
(
x
==
CODE_messages_sent_message
||
x
==
CODE_messages_sent_message_link
);
int
id
=
fetch_int
();
// id
struct
tgl_message
*
M
=
q
->
extra
;
if
(
M
->
id
!=
id
)
{
long
long
y
=
*
(
long
long
*
)
q
->
extra
;
tfree
(
q
->
extra
,
8
);
struct
tgl_message
*
M
=
tgl_message_get
(
y
);
if
(
M
&&
M
->
id
!=
id
)
{
bl_do_set_msg_id
(
M
,
id
);
}
int
date
=
fetch_int
();
...
...
@@ -913,11 +915,15 @@ static int msg_send_on_answer (struct query *q UU) {
static
int
msg_send_on_error
(
struct
query
*
q
,
int
error_code
,
int
error_len
,
char
*
error
)
{
vlogprintf
(
E_WARNING
,
"error for query #%lld: #%d :%.*s
\n
"
,
q
->
msg_id
,
error_code
,
error_len
,
error
);
struct
tgl_message
*
M
=
q
->
extra
;
long
long
x
=
*
(
long
long
*
)
q
->
extra
;
tfree
(
q
->
extra
,
8
);
struct
tgl_message
*
M
=
tgl_message_get
(
x
);
if
(
q
->
callback
)
{
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)
(
q
->
callback_extra
,
0
,
M
);
}
bl_do_delete_msg
(
M
);
if
(
M
)
{
bl_do_delete_msg
(
M
);
}
return
0
;
}
...
...
@@ -1017,7 +1023,9 @@ void tgl_do_send_msg (struct tgl_message *M, void (*callback)(void *callback_ext
out_peer_id
(
M
->
to_id
);
out_cstring
(
M
->
message
,
M
->
message_len
);
out_long
(
M
->
id
);
tglq_send_query
(
tgl_state
.
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_methods
,
M
,
callback
,
callback_extra
);
long
long
*
x
=
talloc
(
8
);
*
x
=
M
->
id
;
tglq_send_query
(
tgl_state
.
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_methods
,
x
,
callback
,
callback_extra
);
}
void
tgl_do_send_message
(
tgl_peer_id_t
id
,
const
char
*
msg
,
int
len
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_message
*
M
),
void
*
callback_extra
)
{
...
...
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