telegram-purple/telegram-purple.h

71 lines
2.1 KiB
C
Raw Permalink Normal View History

2014-11-16 20:41:03 +01:00
/*
This file is part of telegram-purple
2014-11-11 20:21:14 +03:00
2014-11-16 20:41:03 +01:00
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
Copyright Matthias Jentsch, Vitaly Valtman, Christopher Althaus, Markus Endres 2014
*/
2014-11-11 20:21:14 +03:00
#ifndef __TG_PURPLE_H__
#define __TG_PURPLE_H__
2014-11-17 16:27:01 +03:00
#include <tgl.h>
2014-11-11 20:21:14 +03:00
#define PLUGIN_ID "prpl-telegram"
#define TELEGRAM_AUTH_MODE_PHONE "phone"
#define TELEGRAM_AUTH_MODE_SMS "sms"
#define TG_AUTHOR "Matthias Jentsch <mtthsjntsch@gmail.com>, Vitaly Valtman, Christopher Althaus <althaus.christopher@gmail.com>, Markus Endres <endresma45241@th-nuernberg.de>. Based on libtgl by Vitaly Valtman."
#define TG_DESCRIPTION "Telegram protocol."
#define TG_VERSION "0.4"
2014-11-11 20:21:14 +03:00
#define TG_BUILD "8"
#include <glib.h>
#include <notify.h>
#include <plugin.h>
#include <version.h>
#include <account.h>
#include <connection.h>
2014-11-17 18:24:09 +03:00
#define TGP_APP_HASH "99428c722d0ed59b9cd844e4577cb4bb"
#define TGP_APP_ID 16154
2014-11-11 20:21:14 +03:00
typedef struct {
struct tgl_state *TLS;
char *hash;
PurpleAccount *pa;
PurpleConnection *gc;
int updated;
GQueue *new_messages;
GHashTable *joining_chats;
guint timer;
} telegram_conn;
struct download_desc {
int type;
void *data;
};
2014-11-21 17:44:49 +03:00
struct message_text {
struct tgl_message *M;
char *text;
};
void on_chat_get_info (struct tgl_state *TLS, void *extra, int success, struct tgl_chat *C);
void on_ready (struct tgl_state *TLS);
2014-11-13 00:45:51 +01:00
extern const char *pk_path;
extern const char *config_dir;
extern PurplePlugin *_telegram_protocol;
2014-11-13 00:45:51 +01:00
2014-11-11 20:21:14 +03:00
#endif