Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DBus ClanLeave method #382

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ DBUS_OBJ= \
./src/dbus/methods/room_say.o \
./src/dbus/methods/room_start.o \
./src/dbus/methods/room_take_class.o \
./src/dbus/methods/clan_leave.o \
$(DBUS_API_GENERATED).o

manager: | options
Expand Down
3 changes: 3 additions & 0 deletions include/wb_dbus_methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ gboolean on_handle_room_take_class(Warfacebot *object,
GDBusMethodInvocation *invocation,
const gchar *arg_ClassName);

gboolean on_handle_clan_leave(Warfacebot *object,
GDBusMethodInvocation *invocation);

gboolean on_handle_chat_room_join(Warfacebot *object,
GDBusMethodInvocation *invocation,
const gchar *arg_Jid);
Expand Down
40 changes: 40 additions & 0 deletions src/dbus/methods/clan_leave.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* WarfaceBot, a blind XMPP client for Warface (FPS)
* Copyright (C) 2015-2017 Levak Borok <levak92@gmail.com>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <gio/gio.h>

#include <wb_dbus_methods.h>

#include <wb_cmd.h>


/*
** DBus method call: "ClanLeave"
*/
gboolean on_handle_clan_leave(Warfacebot *object,
GDBusMethodInvocation *invocation)
{

cmd_clan_leave();

warfacebot_complete_clan_leave(
object,
invocation);

return TRUE;
}
4 changes: 4 additions & 0 deletions src/dbus/org.levak.Warfacebot.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
<arg name="Stats" type="a(si)" direction="out" />
</method>

<!-- Clan management -->
<method name="ClanLeave">
</method>


<!-- Signals -->
<!--
Expand Down
1 change: 1 addition & 0 deletions src/dbus/wbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ static void on_bus_acquired(GDBusConnection *connection,
iface->handle_room_say = on_handle_room_say;
iface->handle_room_start = on_handle_room_start;
iface->handle_room_take_class = on_handle_room_take_class;
iface->handle_clan_leave = on_handle_clan_leave;

ret = g_dbus_interface_skeleton_export(
G_DBUS_INTERFACE_SKELETON (wb),
Expand Down