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
121f0f1d
Commit
121f0f1d
authored
Oct 23, 2013
by
vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unread messages. Added output to dialoglist query
parent
db8a7a77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
queries.c
queries.c
+28
-3
structures.c
structures.c
+2
-0
No files found.
queries.c
View file @
121f0f1d
...
@@ -580,11 +580,19 @@ int get_dialogs_on_answer (struct query *q UU) {
...
@@ -580,11 +580,19 @@ int get_dialogs_on_answer (struct query *q UU) {
assert
(
fetch_int
()
==
CODE_vector
);
assert
(
fetch_int
()
==
CODE_vector
);
int
n
,
i
;
int
n
,
i
;
n
=
fetch_int
();
n
=
fetch_int
();
static
int
dlist
[
3
*
100
];
int
dl_size
=
n
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
assert
(
fetch_int
()
==
CODE_dialog
);
assert
(
fetch_int
()
==
CODE_dialog
);
fetch_peer_id
();
if
(
i
<
100
)
{
fetch_int
();
dlist
[
3
*
i
+
0
]
=
fetch_peer_id
();
fetch_int
();
dlist
[
3
*
i
+
1
]
=
fetch_int
();
dlist
[
3
*
i
+
2
]
=
fetch_int
();
}
else
{
fetch_peer_id
();
fetch_int
();
fetch_int
();
}
}
}
assert
(
fetch_int
()
==
CODE_vector
);
assert
(
fetch_int
()
==
CODE_vector
);
n
=
fetch_int
();
n
=
fetch_int
();
...
@@ -601,6 +609,23 @@ int get_dialogs_on_answer (struct query *q UU) {
...
@@ -601,6 +609,23 @@ int get_dialogs_on_answer (struct query *q UU) {
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
fetch_alloc_user
();
fetch_alloc_user
();
}
}
print_start
();
push_color
(
COLOR_YELLOW
);
for
(
i
=
dl_size
-
1
;
i
>=
0
;
i
--
)
{
if
(
dlist
[
3
*
i
]
<
0
)
{
union
user_chat
*
UC
=
user_chat_get
(
dlist
[
3
*
i
]);
printf
(
"Chat "
);
print_chat_name
(
dlist
[
3
*
i
],
UC
);
printf
(
": %d unread
\n
"
,
dlist
[
3
*
i
+
2
]);
}
else
{
union
user_chat
*
UC
=
user_chat_get
(
dlist
[
3
*
i
]);
printf
(
"User "
);
print_user_name
(
dlist
[
3
*
i
],
UC
);
printf
(
": %d unread
\n
"
,
dlist
[
3
*
i
+
2
]);
}
}
pop_color
();
print_end
();
return
0
;
return
0
;
}
}
...
...
structures.c
View file @
121f0f1d
...
@@ -262,6 +262,7 @@ void fetch_message_short (struct message *M) {
...
@@ -262,6 +262,7 @@ void fetch_message_short (struct message *M) {
M
->
date
=
fetch_int
();
M
->
date
=
fetch_int
();
fetch_int
();
// seq
fetch_int
();
// seq
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
unread
=
1
;
}
}
void
fetch_message_short_chat
(
struct
message
*
M
)
{
void
fetch_message_short_chat
(
struct
message
*
M
)
{
...
@@ -274,6 +275,7 @@ void fetch_message_short_chat (struct message *M) {
...
@@ -274,6 +275,7 @@ void fetch_message_short_chat (struct message *M) {
M
->
date
=
fetch_int
();
M
->
date
=
fetch_int
();
fetch_int
();
// seq
fetch_int
();
// seq
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
unread
=
1
;
}
}
...
...
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