2014-11-16 20:41:03 +01:00
|
|
|
/*
|
|
|
|
This file is part of telegram-purple
|
|
|
|
|
|
|
|
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 __TELEGRAM_BASE_H__
|
|
|
|
#define __TELEGRAM_BASE_H__
|
2014-12-24 02:44:10 +01:00
|
|
|
|
|
|
|
#include "telegram-purple.h"
|
|
|
|
|
2015-05-29 18:25:55 +02:00
|
|
|
struct request_password_data {
|
|
|
|
struct tgl_state *TLS;
|
2015-08-15 15:14:27 +02:00
|
|
|
void (*callback)(struct tgl_state *TLS, const char *string[], void *arg);
|
2015-05-29 18:25:55 +02:00
|
|
|
void *arg;
|
|
|
|
};
|
|
|
|
|
2014-11-11 20:21:14 +03:00
|
|
|
void read_state_file (struct tgl_state *TLS);
|
|
|
|
void read_auth_file (struct tgl_state *TLS);
|
|
|
|
void write_auth_file (struct tgl_state *TLS);
|
|
|
|
void write_state_file (struct tgl_state *TLS);
|
2015-04-06 16:43:10 +02:00
|
|
|
void write_files_schedule (struct tgl_state *TLS);
|
2015-01-04 12:36:13 +01:00
|
|
|
void read_secret_chat_file (struct tgl_state *TLS);
|
|
|
|
void write_secret_chat_file (struct tgl_state *TLS);
|
2015-04-05 00:38:22 +02:00
|
|
|
void write_secret_chat_gw (struct tgl_state *TLS, void *extra, int success, struct tgl_secret_chat *E);
|
2014-11-11 20:21:14 +03:00
|
|
|
|
|
|
|
void telegram_login (struct tgl_state *TLS);
|
2014-11-26 09:30:43 +01:00
|
|
|
void request_code_entered (gpointer data, const gchar *code);
|
2015-08-15 15:14:27 +02:00
|
|
|
void request_password (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, const char *string[], void *arg),
|
|
|
|
void *arg);
|
2015-04-05 00:38:22 +02:00
|
|
|
void request_accept_secret_chat (struct tgl_state *TLS, struct tgl_secret_chat *U);
|
2015-05-02 14:28:49 +02:00
|
|
|
|
2015-07-18 03:00:11 +02:00
|
|
|
void request_create_chat (struct tgl_state *TLS, const char *subject);
|
|
|
|
|
2015-05-02 14:28:49 +02:00
|
|
|
gchar *get_config_dir (struct tgl_state *TLS, char const *username);
|
|
|
|
gchar *get_download_dir (struct tgl_state *TLS);
|
|
|
|
void assert_file_exists (PurpleConnection *gc, const char *filepath, const char *format);
|
|
|
|
|
2015-05-24 00:23:28 +02:00
|
|
|
int tgp_visualize_key(struct tgl_state *TLS, unsigned char* sha1_key);
|
2015-07-24 14:25:05 +02:00
|
|
|
void tgp_create_group_chat_by_usernames (struct tgl_state *TLS, const char *title,
|
|
|
|
const char *users[], int num_users, int print_names);
|
2015-05-24 00:23:28 +02:00
|
|
|
|
2015-08-01 23:34:00 +02:00
|
|
|
void tgp_notify_on_error_gw (struct tgl_state *TLS, void *extra, int success);
|
2014-11-11 20:21:14 +03:00
|
|
|
#endif
|