2014-09-02 13:59:07 +02:00
|
|
|
#ifndef TOX_WEECHAT_TOX_H
|
|
|
|
#define TOX_WEECHAT_TOX_H
|
|
|
|
|
2014-09-07 03:04:42 +02:00
|
|
|
#include <stdint.h>
|
2014-09-02 13:59:07 +02:00
|
|
|
|
2014-09-05 16:53:44 +02:00
|
|
|
struct t_tox_weechat_identity
|
|
|
|
{
|
2014-09-07 03:04:42 +02:00
|
|
|
struct Tox *tox;
|
2014-09-05 16:53:44 +02:00
|
|
|
|
|
|
|
char *name;
|
|
|
|
char *data_path;
|
|
|
|
|
|
|
|
struct t_gui_buffer *buffer;
|
|
|
|
|
|
|
|
int is_connected;
|
|
|
|
|
2014-09-07 03:04:42 +02:00
|
|
|
struct t_tox_weechat_chat *chats;
|
|
|
|
struct t_tox_weechat_chat *last_chat;
|
|
|
|
|
|
|
|
struct t_tox_weechat_friend_request *friend_requests;
|
|
|
|
struct t_tox_weechat_friend_request *last_friend_request;
|
|
|
|
unsigned int friend_request_count;
|
|
|
|
unsigned int max_friend_requests;
|
|
|
|
|
2014-09-05 16:53:44 +02:00
|
|
|
struct t_tox_weechat_identity *next_identity;
|
|
|
|
struct t_tox_weechat_identity *prev_identity;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct t_tox_weechat_identity *tox_weechat_identities;
|
2014-09-07 03:04:42 +02:00
|
|
|
extern struct t_tox_weechat_identity *tox_weechat_last_identity;
|
2014-09-05 16:53:44 +02:00
|
|
|
|
2014-09-02 13:59:07 +02:00
|
|
|
/**
|
|
|
|
* Initialize the Tox object, bootstrap the DHT and start working.
|
|
|
|
*/
|
|
|
|
void tox_weechat_tox_init();
|
|
|
|
|
2014-09-07 03:04:42 +02:00
|
|
|
struct t_tox_weechat_identity *tox_weechat_identity_for_buffer(struct t_gui_buffer *buffer);
|
|
|
|
|
2014-09-05 16:53:44 +02:00
|
|
|
void tox_weechat_init_identity(struct t_tox_weechat_identity *identity);
|
|
|
|
|
2014-09-02 23:36:24 +02:00
|
|
|
/**
|
|
|
|
* Bootstrap DHT using an inet address, port and a Tox address.
|
|
|
|
*/
|
2014-09-02 23:40:54 +02:00
|
|
|
int tox_weechat_bootstrap(char *address, uint16_t port, char *public_key);
|
2014-09-07 03:04:42 +02:00
|
|
|
int tox_weechat_bootstrap_tox(struct Tox *tox, char *address, uint16_t port, char *public_key);
|
2014-09-02 23:36:24 +02:00
|
|
|
|
2014-09-02 13:59:07 +02:00
|
|
|
/**
|
|
|
|
* Dump Tox to file and de-initialize.
|
|
|
|
*/
|
2014-09-02 18:47:08 +02:00
|
|
|
void tox_weechat_tox_free();
|
2014-09-02 13:59:07 +02:00
|
|
|
|
|
|
|
#endif // TOX_WEECHAT_TOX_H
|