UI data is stored on GObjects and automatically destroyed, so this isn't
really needed as a UI op for *our* UIs. There will be a replacement soon
if needed by other UIs.
/**
* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* Nullprpl is a mock protocol plugin for Pidgin and libpurple. You can create
* accounts with it, sign on and off, add buddies, and send and receive IMs,
* all without connecting to a server!
*
* Beyond that basic functionality, nullprpl supports presence and
* away/available messages, offline messages, user info, typing notification,
* privacy allow/block lists, chat rooms, room lists, and protocol
* icons and emblems. Notable missing features are file transfer and account
* registration and authentication.
*
* Nullprpl is intended as an example of how to write a libpurple protocol
* plugin. It doesn't contain networking code or an event loop, but it does
* demonstrate how to use the libpurple API to do pretty much everything a
* protocol might need to do.
*
* Nullprpl is also a useful tool for hacking on Pidgin, Finch, and other
* libpurple clients. It's a full-featured protocol plugin, but doesn't depend
* on an external server, so it's a quick and easy way to exercise test new
* code. It also allows you to work while you're disconnected.
*
* 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 02111-1301 USA
*/
#include<stdarg.h>
#include<string.h>
#include<time.h>
#include<glib.h>
/* If you're using this as the basis of a protocol that will be distributed
* separately from libpurple, remove the internal.h include below and replace
* it with code to include your own config.h or similar. If you're going to
* provide for translation, you'll also need to setup the gettext macros. */
#include"internal.h"
#include<purple.h>
#include"nullprpl.h"
/*
* reference to the protocol instance, used for registering signals, prefs,
* etc. it is set when the protocol is added in plugin_load and is required
* for removing the protocol in plugin_unload.
*/
staticPurpleProtocol*my_protocol=NULL;
#define NULL_STATUS_ONLINE "online"
#define NULL_STATUS_AWAY "away"
#define NULL_STATUS_OFFLINE "offline"
typedefvoid(*GcFunc)(PurpleConnection*from,
PurpleConnection*to,
gpointeruserdata);
typedefstruct{
GcFuncfn;
PurpleConnection*from;
gpointeruserdata;
}GcFuncData;
/*
* stores offline messages that haven't been delivered yet. maps username
* (char *) to GList * of GOfflineMessages. initialized in plugin_load.