grim/purple-spasm

3c2a35b27899
Add some basic send message support and replies for pings
/*
* PurpleSpasm - A Twitch Protocol Plugin
* Copyright (C) 2017 Gary Kramlich <grim@reaperworld.com>
*
* This program 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 2
* 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <glib.h>
#define PURPLE_PLUGINS
#include "account.h"
#include "blist.h"
#include "connection.h"
#include "debug.h"
#include "notify.h"
#include "plugin.h"
#include "prpl.h"
#include "request.h"
#include "status.h"
#include "version.h"
#include "spasm-account.h"
#include "spasm-const.h"
/******************************************************************************
* Helpers
*****************************************************************************/
/******************************************************************************
* Implementations
*****************************************************************************/
static const gchar *
_purple_spasm_list_icon(PurpleAccount *account, PurpleBuddy *buddy) {
return "spasm";
}
static void
_purple_spasm_close(PurpleConnection *connection) {
}
static GList *
_purple_spasm_get_status_types(PurpleAccount *account) {
GList *types = NULL;
PurpleStatusType *status;
status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, "online", "Online", TRUE, TRUE, FALSE);
types = g_list_append(types, status);
status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, NULL, "Offline", TRUE, TRUE, FALSE);
types = g_list_append(types, status);
return types;
}
static void
_purple_spasm_set_status(PurpleAccount *account, PurpleStatus *status) {
}
/******************************************************************************
* Plugin Stuff
*****************************************************************************/
static PurplePluginProtocolInfo prpl_info = {
.struct_size = sizeof(PurplePluginProtocolInfo),
.options = OPT_PROTO_NO_PASSWORD,
.login = purple_spasm_account_login,
.close = _purple_spasm_close,
.list_icon = _purple_spasm_list_icon,
.status_types = _purple_spasm_get_status_types,
.set_status = _purple_spasm_set_status,
};
static PurplePluginInfo info = {
.magic = PURPLE_PLUGIN_MAGIC,
.major_version = PURPLE_MAJOR_VERSION,
.minor_version = PURPLE_MINOR_VERSION,
.type = PURPLE_PLUGIN_PROTOCOL,
.priority = PURPLE_PRIORITY_DEFAULT,
.id = PURPLE_SPASM_PLUGIN_ID,
.name = "Twitch",
.version = PLUGIN_VERSION,
.extra_info = &prpl_info,
.summary = "Twitch.tv Protocol Plugin",
.description = "Implements the Twitch.tv chat protocol",
.author = "Gary Kramlich <grim@reaperworld.com>",
.homepage = "https://bitbucket.org/rw_grim/purple-spasm",
};
static void
_purple_spasm_init(PurplePlugin *plugin) {
}
PURPLE_INIT_PLUGIN(purple_spasm, _purple_spasm_init, info);