telegram-purple/purple-plugin/telegram-purple.h
2014-10-06 23:18:45 +02:00

87 lines
2.2 KiB
C

/**
* 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
*/
#ifndef __TG_PURPLE_H__
#define __TG_PURPLE_H__
#define PLUGIN_ID "prpl-telegram"
#define TELEGRAM_AUTH_MODE_PHONE "phone"
#define TELEGRAM_AUTH_MODE_SMS "sms"
#define TG_AUTHOR "Christopher Althaus <althaus.christopher@gmail.com>, Markus Endres <endresma45241@th-nuernberg.de>, Matthias Jentsch <mtthsjntsch@gmail.com>"
#define TG_DESCRIPTION "A protocol plugin that adds support for the Telegram messenger."
#define TG_VERSION "0.3.1"
#define TG_BUILD "4"
#include <glib.h>
#include "notify.h"
#include "plugin.h"
#include "version.h"
#include "account.h"
#include "connection.h"
#include "mtproto-client.h"
typedef struct {
struct telegram *tg;
PurpleAccount *pa;
PurpleConnection *gc;
/**
* Whether the state of the protocol has changed since the last save
*/
int updated;
/**
* The used purple timeout handler
*/
guint timer;
/**
* Queue of all new messages that need to be added to a chat
*/
GQueue *new_messages;
/**
* Queue of all joined chats
*/
GHashTable *joining_chats;
} telegram_conn;
typedef struct {
/**
* The mtproto_connection associated with this handle
*/
struct mtproto_connection *mtp;
/**
* Write handler returned by purple_input_add
*/
guint wh;
/**
* Read handler returned by purple_input_add
*/
guint rh;
/**
* The file descriptor of the used socket
*/
int fd;
} mtproto_handle;
#endif