grim/purple-spasm
Clone
Summary
Browse
Changes
Graph
Add our protocol icons
2017-05-11, Gary Kramlich
0064766dd97a
Add our protocol icons
/*
* 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-auth.h"
#include
"spasm-const.h"
/******************************************************************************
* Helpers
*****************************************************************************/
/******************************************************************************
* Implementations
*****************************************************************************/
static
const
gchar
*
purple_spasm_list_icon
(
PurpleAccount
*
account
,
PurpleBuddy
*
buddy
)
{
return
NULL
;
}
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_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
init_plugin
(
PurplePlugin
*
plugin
)
{
}
PURPLE_INIT_PLUGIN
(
purple_spasm
,
init_plugin
,
info
);