Vulpes - XMPP Bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.7 KiB

/*
* vim: expandtab:ts=2:sts=2:sw=2
*
* Copyright (C) 2021 DebXWoody <stefan@devlug.de>
*
* This file is part of vulpes.
*
* vulpes is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* vulpes 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 General Public License
* along with buteo. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mod_admin.h"
#define MOD_NAME "mod_admin"
#define MOD_VERSION "0.0.0-dev"
#define LOG_DOMAIN "vulpes-mod-admin"
vulpes_err_code_t module_load(vulpes_ctx_t *vulpes_ctx) {
g_log(LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Loading %s (%s)...", MOD_NAME, MOD_VERSION );
return VULPES_SUCCESS;
}
vulpes_err_code_t module_unload(vulpes_ctx_t *vulpes_ctx) {
return VULPES_SUCCESS;
}
vulpes_err_code_t chat(vulpes_ctx_t *vulpes_ctx, const lutjanus_xmpp_adr_t* from, const char *const message) {
g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "Incoming messsage from %s: %s", from, message);
if ( !g_str_has_prefix (message, "!admin") ) {
return VULPES_SUCCESS;
}
if(is_admin(vulpes_ctx, from)) {
return mod_api_send_chat_message(vulpes_ctx, from, "Admin command done!");
}
return VULPES_SUCCESS;
}
vulpes_err_code_t group_command_execute(vulpes_ctx_t *vulpes_ctx,
const char *const command) {
return VULPES_SUCCESS;
}