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
c509422c
Commit
c509422c
authored
Nov 07, 2013
by
vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added global_search query
parent
9eadb3e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
interface.c
interface.c
+17
-2
queries.c
queries.c
+9
-1
No files found.
interface.c
View file @
c509422c
...
...
@@ -255,6 +255,7 @@ char *commands[] = {
"visualize_key"
,
"create_secret_chat"
,
"suggested_contacts"
,
"global_search"
,
0
};
int
commands_flags
[]
=
{
...
...
@@ -285,6 +286,7 @@ int commands_flags[] = {
075
,
071
,
07
,
07
,
};
int
get_complete_mode
(
void
)
{
...
...
@@ -745,6 +747,17 @@ void interpreter (char *line UU) {
RET
;
}
do_msg_search
(
id
,
from
,
to
,
limit
,
s
);
}
else
if
(
IS_WORD
(
"global_search"
))
{
int
from
=
0
;
int
to
=
0
;
int
limit
=
40
;
int
t
;
char
*
s
=
next_token
(
&
t
);
if
(
!
s
)
{
printf
(
"Empty message
\n
"
);
RET
;
}
do_msg_search
(
PEER_NOT_FOUND
,
from
,
to
,
limit
,
s
);
}
else
if
(
IS_WORD
(
"mark_read"
))
{
GET_PEER
;
do_mark_read
(
id
);
...
...
@@ -916,9 +929,11 @@ void print_user_name (peer_id_t id, peer_t *U) {
if
(
U
->
flags
&
(
FLAG_USER_SELF
|
FLAG_USER_CONTACT
))
{
push_color
(
COLOR_REDB
);
}
if
(
!
U
->
user
.
first_name
)
{
if
((
U
->
flags
&
FLAG_DELETED
)
||
(
U
->
flags
&
FLAG_EMPTY
))
{
printf
(
"deleted user#%d"
,
get_peer_id
(
id
));
}
else
if
(
!
U
->
user
.
first_name
||
!
strlen
(
U
->
user
.
first_name
))
{
printf
(
"%s"
,
U
->
user
.
last_name
);
}
else
if
(
!
U
->
user
.
last_name
)
{
}
else
if
(
!
U
->
user
.
last_name
||
!
strlen
(
U
->
user
.
last_name
)
)
{
printf
(
"%s"
,
U
->
user
.
first_name
);
}
else
{
printf
(
"%s %s"
,
U
->
user
.
first_name
,
U
->
user
.
last_name
);
...
...
queries.c
View file @
c509422c
...
...
@@ -1971,9 +1971,17 @@ struct query_methods msg_search_methods = {
};
void
do_msg_search
(
peer_id_t
id
,
int
from
,
int
to
,
int
limit
,
const
char
*
s
)
{
if
(
get_peer_type
(
id
)
==
PEER_ENCR_CHAT
)
{
rprintf
(
"Can not search in secure chat
\n
"
);
return
;
}
clear_packet
();
out_int
(
CODE_messages_search
);
out_peer_id
(
id
);
if
(
get_peer_type
(
id
)
==
PEER_UNKNOWN
)
{
out_int
(
CODE_input_peer_empty
);
}
else
{
out_peer_id
(
id
);
}
out_string
(
s
);
out_int
(
CODE_input_messages_filter_empty
);
out_int
(
from
);
...
...
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