summaryrefslogtreecommitdiff
path: root/plugins/GmailNotifier/src/gmail.h
blob: 4f9517314110f1ab305d573576d8db2fc19fe5f9 (plain)
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
#define _CRT_SECURE_NO_WARNINGS

#include <windows.h>
#include <wininet.h>
#include <time.h>
#include <stdio.h>
#include "resource.h"

#include "newpluginapi.h"
#include "m_clist.h"
#include "m_clui.h"
#include "m_skin.h"
#include "m_langpack.h"
#include "m_protomod.h"
#include "m_database.h"
#include "m_system.h"
#include "m_protocols.h"
#include "m_userinfo.h"
#include "m_options.h"
#include "m_protosvc.h"
#include "m_utils.h"
#include "m_ignore.h"
#include "m_clc.h"
#include "m_popup.h"
#include "m_netlib.h"

#define WM_SHELLNOTIFY 	WM_USER+5
#define IDI_TRAY		WM_USER+6
#define pluginName		"GmailMNotifier"
#define _MAX_DOWN_BUFFER 65536
#define LINK "https://www.google.com/accounts/ServiceLoginAuth?continue=https%3A%2F%2Fmail.google.com%2Fmail&service=mail&Email="
#define FORMDATA1 "<body onload=document.gmail.submit();><form name=gmail action=https://www.google.com/a/"
#define FORMDATA2 "/LoginAction method=POST><input type=hidden name=continue value=https://mail.google.com/a/"
#define FORMDATA3 "><INPUT type=hidden value=mail name=service>"
// #define STR1 "javascript:document.write('<form name=gmail action=https://www.google.com/a/"
// #define STR2 "/LoginAction method=post><input type=hidden name=continue value=https://mail.google.com/hosted/"
// #define STR3 "><input type=hidden value=mail name=service><input type=hidden name=userName value="
// #define STR4 "><input type=hidden name=password value="
// #define STR5 ">');document.gmail.submit();"
//#define LINK2 "https://www.google.com/a/altmanoptik.com/LoginAction?continue=https%3A%2F%2Fmail.google.com%2Fhosted%2Faltmanoptik.com&service=mail&userName=test&password=123456"

typedef struct s_resultLink{
	char content[64];
	struct s_resultLink *next;
}resultLink;

typedef struct s_Account{
	char name[64];
	char pass[64];
	char hosted[64];
	MCONTACT hContact;
	int oldResults_num;
	int	results_num;
	resultLink results;
	HWND popUpHwnd;
	BOOL IsChecking;
}Account;

typedef struct s_optionSettings{
	int circleTime;
	BOOL notifierOnTray;
	BOOL notifierOnPop;
	int popupDuration;
	COLORREF popupTxtColor;
	COLORREF popupBgColor;
	int OpenUsePrg;
	BOOL ShowCustomIcon;
	BOOL UseOnline;
	int AutoLogin;
	BOOL LogThreads;
}optionSettings;

extern int acc_num;
extern Account *acc;
extern optionSettings opt;
extern HINSTANCE hInst;
extern UINT hTimer;
extern short ID_STATUS_NONEW;
extern BOOL optionWindowIsOpen;

INT_PTR Notifying(WPARAM, LPARAM);
INT_PTR PluginMenuCommand(WPARAM, LPARAM);
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD);
BOOL GetBrowser(char *);
void CheckMailInbox(Account *);
void NotifyUser(Account *);
int OptInit(WPARAM, LPARAM);
void Check_ThreadFunc(LPVOID);
void Login_ThreadFunc(LPVOID);
int OpenBrowser(WPARAM , LPARAM);
int ParsePage(char *, resultLink *);
void DeleteResults(resultLink *);
void BuildList(void);

Account* GetAccountByContact(MCONTACT hContact);