Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
48d34047
Commit
48d34047
authored
Jan 23, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: don't advertise "sticker" unless configured
In the return value of the "commands" command, don't list the "sticker" command if no sticker file is configured.
parent
0e5af7d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
command.c
src/command.c
+13
-1
No files found.
src/command.c
View file @
48d34047
...
@@ -1550,6 +1550,17 @@ static const struct command commands[] = {
...
@@ -1550,6 +1550,17 @@ static const struct command commands[] = {
static
const
unsigned
num_commands
=
sizeof
(
commands
)
/
sizeof
(
commands
[
0
]);
static
const
unsigned
num_commands
=
sizeof
(
commands
)
/
sizeof
(
commands
[
0
]);
static
bool
command_available
(
const
struct
command
*
cmd
)
{
#ifdef ENABLE_SQLITE
if
(
strcmp
(
cmd
->
cmd
,
"sticker"
)
==
0
)
return
sticker_enabled
();
#endif
return
true
;
}
/* don't be fooled, this is the command handler for "commands" command */
/* don't be fooled, this is the command handler for "commands" command */
static
enum
command_return
static
enum
command_return
handle_commands
(
struct
client
*
client
,
handle_commands
(
struct
client
*
client
,
...
@@ -1561,7 +1572,8 @@ handle_commands(struct client *client,
...
@@ -1561,7 +1572,8 @@ handle_commands(struct client *client,
for
(
unsigned
i
=
0
;
i
<
num_commands
;
++
i
)
{
for
(
unsigned
i
=
0
;
i
<
num_commands
;
++
i
)
{
cmd
=
&
commands
[
i
];
cmd
=
&
commands
[
i
];
if
(
cmd
->
permission
==
(
permission
&
cmd
->
permission
))
if
(
cmd
->
permission
==
(
permission
&
cmd
->
permission
)
&&
command_available
(
cmd
))
client_printf
(
client
,
"command: %s
\n
"
,
cmd
->
cmd
);
client_printf
(
client
,
"command: %s
\n
"
,
cmd
->
cmd
);
}
}
...
...
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