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
2015-03-12 01:47:57 +01:00
Copyright Matthias Jentsch , Vitaly Valtman , Christopher Althaus , Markus Endres 2014 - 2015
2014-11-16 20:41:03 +01:00
*/
2014-11-11 20:21:14 +03:00
# ifndef __TG_PURPLE_H__
# define __TG_PURPLE_H__
2015-10-04 16:58:25 +02:00
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
// Define macros for gettext translation, ENABLE_NLS should be set if configure has detected
// libintl.h. If this is not the case a dummy macro is defined to bypass the translation functions
# ifdef ENABLE_NLS
# include <glib / gi18n-lib.h>
2015-10-19 20:10:47 +02:00
# define P_(Singular,Plural,N) ((char *) g_dngettext (GETTEXT_PACKAGE, Singular, Plural, N))
2015-10-06 21:45:26 +02:00
# else
2015-10-04 16:58:25 +02:00
# define _(String) String
2015-10-19 20:10:47 +02:00
# define P_(Singular,Plural,N) Plural
2015-10-04 16:58:25 +02:00
# endif
2014-11-11 20:21:14 +03:00
2015-10-04 16:58:25 +02:00
# include <tgl.h>
2015-11-23 03:06:30 +01:00
# include <tgl-binlog.h>
# include <tgl-queries.h>
# include <tgl-structures.h>
# include <glib.h>
2015-10-07 01:30:28 +02:00
# include <purple.h>
2015-10-04 16:58:25 +02:00
2015-11-23 03:06:30 +01:00
# include "telegram-base.h"
2015-10-11 14:17:24 +02:00
# include "tgp-blist.h"
# include "tgp-structs.h"
2015-11-23 03:06:30 +01:00
# include "tgp-2prpl.h"
# include "tgp-net.h"
# include "tgp-timers.h"
# include "tgp-utils.h"
# include "tgp-chat.h"
# include "tgp-ft.h"
# include "tgp-msg.h"
# include "tgp-request.h"
# include "msglog.h"
2015-10-11 14:17:24 +02:00
2015-10-04 16:58:25 +02:00
# define PLUGIN_ID "prpl-telegram"
2015-10-07 21:23:03 +02:00
// FIXME: Name must be translated (for languages without latin script, it would look like gibberish. Just like Japanese script looks to me.)
2015-12-18 12:25:51 +01:00
# define TG_AUTHOR "Matthias Jentsch <mtthsjntsch@gmail.com>, Vitaly Valtman, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>, Christopher Althaus <althaus.christopher@gmail.com>, based on libtgl by Vitaly Valtman."
2015-10-04 16:58:25 +02:00
# define TG_DESCRIPTION "Telegram protocol."
# define TG_BUILD "13"
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
2015-03-10 16:11:06 +01:00
# define TGP_MAX_MSG_SIZE 4096
2015-03-14 18:00:37 +01:00
# define TGP_DEFAULT_MAX_MSG_SPLIT_COUNT 4
2015-05-30 15:52:17 +02:00
# define TGP_KEY_PASSWORD_TWO_FACTOR "password-two-factor"
2015-03-14 18:00:37 +01:00
# define TGP_DEFAULT_ACCEPT_SECRET_CHATS "ask"
# define TGP_KEY_ACCEPT_SECRET_CHATS "accept-secret-chats"
2015-03-13 16:57:08 +01:00
# define TGP_DEFAULT_INACTIVE_DAYS_OFFLINE 7
2015-03-14 18:00:37 +01:00
# define TGP_KEY_INACTIVE_DAYS_OFFLINE "inactive-days-offline"
2015-03-13 00:13:27 +01:00
# define TGP_DEFAULT_HISTORY_RETRIEVAL_THRESHOLD 14
2015-03-14 18:00:37 +01:00
# define TGP_KEY_HISTORY_RETRIEVAL_THRESHOLD "history-retrieve-days"
2015-03-13 00:13:27 +01:00
2015-09-12 22:21:27 +02:00
# define TGP_DEFAULT_JOIN_GROUP_CHATS FALSE
# define TGP_KEY_JOIN_GROUP_CHATS "auto-join-group-chats"
2015-05-30 15:52:17 +02:00
# define TGP_DEFAULT_DISPLAY_READ_NOTIFICATIONS FALSE
# define TGP_KEY_DISPLAY_READ_NOTIFICATIONS "display-read-notifications"
# define TGP_DEFAULT_SEND_READ_NOTIFICATIONS TRUE
# define TGP_KEY_SEND_READ_NOTIFICATIONS "send-read-notifications"
2015-05-29 18:25:55 +02:00
2014-11-13 00:45:51 +01:00
extern const char * pk_path ;
2015-10-10 17:13:07 +02:00
extern const char * user_pk_filename ;
2014-11-16 16:33:27 +01:00
extern const char * config_dir ;
2014-11-16 21:55:36 +01:00
extern PurplePlugin * _telegram_protocol ;
2015-07-19 15:18:59 +02:00
void export_chat_link_checked ( struct tgl_state * TLS , const char * name ) ;
2015-07-24 14:26:13 +02:00
void import_chat_link_checked ( struct tgl_state * TLS , const char * link ) ;
2015-10-31 20:11:31 +01:00
void leave_and_delete_chat ( struct tgl_state * TLS , tgl_peer_t * P ) ;
2014-11-13 00:45:51 +01:00
2014-11-11 20:21:14 +03:00
# endif