Skip to content
GitLab
Explore
Sign in
Commits on Source (2)
Attempt to remove pid from wholist
· a0896b3b
Imran Hussain
authored
Feb 27, 2016
a0896b3b
Make formatting nicer
· aa185482
Imran Hussain
authored
Feb 27, 2016
aa185482
Hide whitespace changes
Inline
Side-by-side
src/client/who.c
View file @
aa185482
...
...
@@ -78,7 +78,7 @@ void display_wholist(int mode)
if
(
mode
==
1
)
format_message
(
"
\n
User status..."
);
else
format_message
(
"
\n
PID
%-*s %-*s Idle What..."
,
NAMESIZE
,
"Name"
,
20
,
"RealName"
);
format_message
(
"
\n
%-*s %-*s Idle What..."
,
NAMESIZE
,
"Name"
,
20
,
"RealName"
);
_autofree
char
*
divider
=
NULL
;
for
(
int
i
=
0
;
i
<
screen_w
();
i
++
)
string_add
(
&
divider
,
"-"
);
...
...
@@ -87,7 +87,6 @@ void display_wholist(int mode)
size_t
wi
;
json_t
*
entry
;
json_array_foreach
(
whoinfo
,
wi
,
entry
)
{
int
pid
=
json_getint
(
entry
,
"pid"
);
const
char
*
name
=
json_getstring
(
entry
,
"name"
);
const
char
*
realname
=
json_getstring
(
entry
,
"realname"
);
time_t
dowhen
=
json_getint
(
entry
,
"dowhen"
);
...
...
@@ -108,7 +107,7 @@ void display_wholist(int mode)
if
(
json_getint
(
perms
,
"wizchat"
)
>
0
)
chat
=
'*'
;
format_message
(
"
%-5d
%c%-*s %-20.20s %6s Room %d (%s,%s,%s)
\033
--"
,
pid
,
chat
,
NAMESIZE
,
name
,
realname
,
itime
(
now
-
idletime
),
channel
,
chatmode
,
prot
,
chatprivs
);
format_message
(
"%c%-*s %-20.20s %6s Room %d (%s,%s,%s)
\033
--"
,
chat
,
NAMESIZE
,
name
,
realname
,
itime
(
now
-
idletime
),
channel
,
chatmode
,
prot
,
chatprivs
);
}
}
format_message
(
"%s"
,
divider
);
...
...