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
f376ad1d
Commit
f376ad1d
authored
Nov 15, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to layer 19
parent
6be3cf0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
13 deletions
+26
-13
interface.c
interface.c
+25
-12
tgl
tgl
+1
-1
No files found.
interface.c
View file @
f376ad1d
...
@@ -1547,6 +1547,26 @@ void print_chat_info_gw (struct tgl_state *TLSR, void *extra, int success, struc
...
@@ -1547,6 +1547,26 @@ void print_chat_info_gw (struct tgl_state *TLSR, void *extra, int success, struc
mprint_end
(
ev
);
mprint_end
(
ev
);
}
}
void
print_user_status
(
struct
tgl_user_status
*
S
,
struct
in_ev
*
ev
)
{
if
(
S
->
online
>
0
)
{
mprintf
(
ev
,
"online"
);
}
else
{
if
(
S
->
online
==
0
)
{
mprintf
(
ev
,
"offline"
);
}
else
if
(
S
->
online
==
-
1
)
{
mprintf
(
ev
,
"offline (was online "
);
print_date_full
(
ev
,
S
->
when
);
mprintf
(
ev
,
")"
);
}
else
if
(
S
->
online
==
-
2
)
{
mprintf
(
ev
,
"offline (was online recently)"
);
}
else
if
(
S
->
online
==
-
3
)
{
mprintf
(
ev
,
"offline (was online last week)"
);
}
else
if
(
S
->
online
==
-
4
)
{
mprintf
(
ev
,
"offline (was online last month)"
);
}
}
}
void
print_user_info_gw
(
struct
tgl_state
*
TLSR
,
void
*
extra
,
int
success
,
struct
tgl_user
*
U
)
{
void
print_user_info_gw
(
struct
tgl_state
*
TLSR
,
void
*
extra
,
int
success
,
struct
tgl_user
*
U
)
{
assert
(
TLS
==
TLSR
);
assert
(
TLS
==
TLSR
);
struct
in_ev
*
ev
=
extra
;
struct
in_ev
*
ev
=
extra
;
...
@@ -1566,13 +1586,9 @@ void print_user_info_gw (struct tgl_state *TLSR, void *extra, int success, struc
...
@@ -1566,13 +1586,9 @@ void print_user_info_gw (struct tgl_state *TLSR, void *extra, int success, struc
mprintf
(
ev
,
" (#%d):
\n
"
,
tgl_get_peer_id
(
U
->
id
));
mprintf
(
ev
,
" (#%d):
\n
"
,
tgl_get_peer_id
(
U
->
id
));
mprintf
(
ev
,
"
\t
real name: %s %s
\n
"
,
U
->
real_first_name
,
U
->
real_last_name
);
mprintf
(
ev
,
"
\t
real name: %s %s
\n
"
,
U
->
real_first_name
,
U
->
real_last_name
);
mprintf
(
ev
,
"
\t
phone: %s
\n
"
,
U
->
phone
);
mprintf
(
ev
,
"
\t
phone: %s
\n
"
,
U
->
phone
);
if
(
U
->
status
.
online
>
0
)
{
mprintf
(
ev
,
"
\t
"
);
mprintf
(
ev
,
"
\t
online
\n
"
);
print_user_status
(
&
U
->
status
,
ev
);
}
else
{
mprintf
(
ev
,
"
\n
"
);
mprintf
(
ev
,
"
\t
offline (was online "
);
print_date_full
(
ev
,
U
->
status
.
when
);
mprintf
(
ev
,
")
\n
"
);
}
mpop_color
(
ev
);
mpop_color
(
ev
);
mprint_end
(
ev
);
mprint_end
(
ev
);
}
}
...
@@ -2014,11 +2030,8 @@ void user_status_upd (struct tgl_state *TLS, struct tgl_user *U) {
...
@@ -2014,11 +2030,8 @@ void user_status_upd (struct tgl_state *TLS, struct tgl_user *U) {
mpush_color
(
ev
,
COLOR_YELLOW
);
mpush_color
(
ev
,
COLOR_YELLOW
);
mprintf
(
ev
,
"User "
);
mprintf
(
ev
,
"User "
);
print_user_name
(
ev
,
U
->
id
,
(
void
*
)
U
);
print_user_name
(
ev
,
U
->
id
,
(
void
*
)
U
);
if
(
U
->
status
.
online
>
0
)
{
mprintf
(
ev
,
" "
);
mprintf
(
ev
,
" online"
);
print_user_status
(
&
U
->
status
,
ev
);
}
else
{
mprintf
(
ev
,
" offline"
);
}
mprintf
(
ev
,
"
\n
"
);
mprintf
(
ev
,
"
\n
"
);
mpop_color
(
ev
);
mpop_color
(
ev
);
mprint_end
(
ev
);
mprint_end
(
ev
);
...
...
tgl
@
43f8247f
Subproject commit
6a59fd311c1246aba4f6fb2c9a28e40e7abb3f2e
Subproject commit
43f8247f0861dd29118380ee18e404025a1204c6
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