summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/guids.h
blob: 7c5ba90686f2463f74c804a813a40ece6cd59059 (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
// ---------------------------------------------------------------------------80
//                ICQ plugin for Miranda Instant Messenger
//                ________________________________________
// 
// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
// Copyright © 2001-2002 Jon Keating, Richard Hughes
// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
// Copyright © 2004-2010 Joe Kucera
// Copyright © 2012-2018 Miranda NG team
// 
// 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 02110-1301 USA.
// -----------------------------------------------------------------------------
//  DESCRIPTION:
//
//  Contains helper functions to handle oscar message GUIDs.
// -----------------------------------------------------------------------------

#ifndef __GUIDS_H
#define __GUIDS_H

typedef DWORD plugin_guid[4];

// Message Capability GUIDs
static const plugin_guid MCAP_SRV_RELAY_FMT = { MCAP_SRV_RELAY_FMT_s };
static const plugin_guid MCAP_REVERSE_DC_REQ = { MCAP_REVERSE_DC_REQ_s };
static const plugin_guid MCAP_FILE_TRANSFER = { MCAP_FILE_TRANSFER_s };
static const plugin_guid MCAP_CONTACTS = { MCAP_CONTACTS_s };

// Plugin GUIDs
static const plugin_guid PSIG_MESSAGE = { PSIG_MESSAGE_s };
static const plugin_guid PSIG_INFO_PLUGIN = { PSIG_INFO_PLUGIN_s };
static const plugin_guid PSIG_STATUS_PLUGIN = { PSIG_STATUS_PLUGIN_s };

// Plugin Message GUIDs
static const plugin_guid PMSG_QUERY_INFO = { PMSG_QUERY_INFO_s };
static const plugin_guid PMSG_QUERY_STATUS = { PMSG_QUERY_STATUS_s };

// Message GUIDs
static const plugin_guid MGTYPE_MESSAGE = { MGTYPE_MESSAGE_s };
static const plugin_guid MGTYPE_STATUSMSGEXT = { MGTYPE_STATUSMSGEXT_s };
static const plugin_guid MGTYPE_FILE = { MGTYPE_FILE_s };
static const plugin_guid MGTYPE_WEBURL = { MGTYPE_WEBURL_s };
static const plugin_guid MGTYPE_CONTACTS = { MGTYPE_CONTACTS_s };
static const plugin_guid MGTYPE_GREETING_CARD = { MGTYPE_GREETING_CARD_s };
static const plugin_guid MGTYPE_CHAT = { MGTYPE_CHAT_s };
static const plugin_guid MGTYPE_SMS_MESSAGE = { MGTYPE_SMS_MESSAGE_s };
static const plugin_guid MGTYPE_XTRAZ_SCRIPT = { MGTYPE_XTRAZ_SCRIPT_s };

// make GUID checks easy
__forceinline bool CompareGUIDs(DWORD q1, DWORD q2, DWORD q3, DWORD q4, const plugin_guid guid)
{
	return ((q1 == guid[0]) && (q2 == guid[1]) && (q3 == guid[2]) && (q4 == guid[3])) ? true : false;
}

// pack entire GUID into icq packet
static __inline void packGUID(icq_packet *packet, const plugin_guid guid)
{
	packDWord(packet, guid[0]);
	packDWord(packet, guid[1]);
	packDWord(packet, guid[2]);
	packDWord(packet, guid[3]);
}

#endif /* __GUIDS_H */