blob: ce72dd27b4f481e920bbee7e25f4f763ed3e57f5 (
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
|
#pragma once
#include "skype.h"
#include <m_chat.h>
class ChatMember
{
public:
wchar_t *sid;
wchar_t *nick;
int rank;
WORD status;
ChatMember()
{
this->sid = NULL;
}
ChatMember(const wchar_t *sid)
{
this->sid = ::mir_wstrdup(sid);
}
~ChatMember()
{
if (this->sid != NULL)
::mir_free(this->sid);
}
bool operator==(const ChatMember &other) const
{
return ::lstrcmp(this->sid, other.sid) == 0;
}
bool operator!=(const ChatMember &other) const
{
return !(*this == other);
}
/*ChatMember& operator=(const ChatMember& right)
{
if (this == &right)
return *this;
::mir_free(this->sid);
this->sid = ::mir_wstrdup(right.sid);
return *this;
}*/
};
class ChatRoom
{
public:
wchar_t *cid;
wchar_t *topic;
ChatMember *me;
LIST<ChatMember> members;
CSkypeProto *ppro;
static wchar_t *Roles[];
ChatRoom(const wchar_t *cid);
ChatRoom(ChatMember *me);
void Start(bool showWindow = false);
void LeaveChat();
void SendChatEvent(const wchar_t *sid, int eventType, DWORD flags = GCEF_ADDTOLOG, DWORD itemData = 0, const wchar_t *status = NULL, const wchar_t *message = NULL, DWORD timestamp = time(NULL));
void Add(ChatMember *member);
void Add(const wchar_t *sid, int rank = 0, WORD status = ID_STATUS_OFFLINE);
private:
static int SortMembers(const ChatMember *p1, const ChatMember *p2);
int __cdecl OnGCEventHook(WPARAM, LPARAM lParam);
int __cdecl OnGCMenuHook(WPARAM, LPARAM lParam);
};
|