This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
forked from mrim-prpl-team/mrim-prpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mrim.h
133 lines (107 loc) · 2.9 KB
/
mrim.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef MRIM_H
#define MRIM_H
#define PURPLE_PLUGINS
#include "config.h"
#define DISPLAY_VERSION "0.2.0"
#include <glib.h>
#define GETTEXT_PACKAGE "mrim-prpl-underbush"
#define LOCALEDIR "po"
#include <glib/gi18n-lib.h>
#include <sys/socket.h>
//#include <netinet/in.h>
//#include <arpa/inet.h>
// libpurple
#include "accountopt.h"
#include "cipher.h"
#include "conversation.h"
#include "core.h"
#include "debug.h"
#include "dnsquery.h"
#include "dnssrv.h"
#include "network.h"
#include "proxy.h"
#include "request.h"
#include "util.h"
#include "version.h"
#ifdef ENABLE_GTK
#include <gtk/gtk.h>
#endif
#include "proto.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
typedef struct _MrimData MrimData;
#include "statuses.h"
struct _MrimData {
PurpleAccount *account;
PurpleConnection *gc;
gchar *user_name;
gchar *password;
gchar *user_agent;
gchar *balancer_host;
guint balancer_port;
gchar *server_host;
guint server_port;
PurpleUtilFetchUrlData *fetch_url;
PurpleProxyConnectData *proxy_connect;
int fd;
guint32 seq;
gpointer inp_package;
guint keepalive_timeout;
gint error_count;
GHashTable *groups;
GHashTable *acks;
GHashTable *transfers;
gboolean use_gtk;
gchar *nick;
MrimStatus *status;
gchar *microblog;
guint mail_count;
};
#include "util.h"
#define MRIM_MAIL_RU "mrim.mail.ru"
#define MRIM_MAIL_RU_PORT 2042
//#define MRIM_MAIL_RU_PORT 443
#define MRIM_MAX_ERROR_COUNT 16
#define MRIM_PRPL_ID "prpl-ostin-mrim-experimental"
#ifdef ENABLE_FILES
#include "ft.h"
#define COM_SUPPORT (FEATURE_FLAG_RTF_MESSAGE | FEATURE_FLAG_BASE_SMILES | FEATURE_FLAG_WAKEUP | FEATURE_FLAG_FILE_TRANSFER)
#else
#define COM_SUPPORT (FEATURE_FLAG_RTF_MESSAGE | FEATURE_FLAG_BASE_SMILES | FEATURE_FLAG_WAKEUP)
#endif
#include "package.h"
#include "mrim-util.h"
typedef struct _MrimAck MrimAck;
struct _MrimAck {
guint32 seq;
void (*func)(MrimData *, gpointer, MrimPackage *);
gpointer data;
};
typedef struct {
guint count;
gchar *from;
gchar *subject;
} MrimNotifyMailData;
#define MRIM_MAGENT_ID "magent"
static struct {
gchar *id;
gchar *title;
} ua_titles[] = {
{MRIM_MAGENT_ID, N_("Mail.ru Agent for Windows")},
{"jagent", N_("Mail.ru Agent for Java")},
{"android", N_("Mail.ru Agent for Android")},
{"webagent", N_("[email protected]")},
{"jmp", N_("[email protected]")},
{"sagent", N_("Mail.ru Agent for Symbian")},
{"iphoneagent", N_("Mail.ru Agent for iPhone")},
{"QIP 2010", N_("QIP 2010")},
{"QIP Infium", N_("QIP Infium")},
{"mrim-prpl", N_("mrim-prpl")},
{"mrimprpl", N_("libpurple plugin by [email protected]")},
{"ru.ibb.im.impl.mra.MraAccount", N_("QIP Mobile for Android")}
};
void mrim_add_ack_cb(MrimData *mrim, guint32 seq, void (*func)(MrimData *, gpointer, MrimPackage *), gpointer data);
void mrim_open_myworld_url(MrimData *mrim, gchar *user_name, gchar *fmt);
void mrim_post_microblog_record(MrimData *mrim, gchar *message);
PurplePlugin *mrim_plugin;
gchar *mrim_user_agent;
#endif