Tue, 07 Jan 2003 17:44:34 +0000
[gaim-migrate @ 4471]
This is a patch from Nathan Walp that adds a
"char server_alias[BUDDY_ALIAS_MAXLEN]" to struct buddy, and a preference
option to show the server alias instead of the alias set by you. It
shouldn't cause any problems. But then again, faceprint is a crazy patch
writer, with an emphasis on crazy, if you know what I mean. Huh? Get it?
"Crazy"? I kill me. But right after I kill Time Warner.
committer: Mark Doliner <markdoliner@pidgin.im>
| 2086 | 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | ||
| 3 | /* | |
| 4 | * $Id: icqevent.h 2096 2001-07-31 01:00:39Z warmenhoven $ | |
| 5 | * | |
| 6 | * Copyright (C) 1998-2001, Denis V. Dmitrienko <denis@null.net> and | |
| 7 | * Bill Soudan <soudan@kde.org> | |
| 8 | * | |
| 9 | * This program is free software; you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with this program; if not, write to the Free Software | |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 22 | * | |
| 23 | */ | |
| 24 | ||
| 25 | #ifndef _ICQEVENT_H | |
| 26 | #define _ICQEVENT_H | |
| 27 | ||
| 28 | #ifdef HAVE_CONFIG_H | |
| 29 | #include <config.h> | |
| 30 | #endif | |
| 31 | ||
| 32 | #include <time.h> | |
| 33 | ||
| 34 | #include "icqpacket.h" | |
| 35 | #include "tcplink.h" | |
| 36 | #include "stdpackets.h" | |
| 37 | ||
| 38 | #define EVENT_DEBUG | |
| 39 | ||
| 40 | #define ICQ_EVENT_MESSAGE ICQ_TCP_MESSAGE | |
| 41 | #define ICQ_EVENT_ACK ICQ_TCP_ACK | |
| 42 | #define ICQ_EVENT_CANCEL ICQ_TCP_CANCEL | |
| 43 | ||
| 44 | #define ICQ_EVENT_INCOMING 1 | |
| 45 | #define ICQ_EVENT_OUTGOING 2 | |
| 46 | ||
| 47 | typedef struct icq_Event_s { | |
| 48 | ||
| 49 | unsigned long version; | |
| 50 | unsigned long id; | |
| 51 | unsigned long uin; | |
| 52 | ||
| 53 | int type; /* chat, file, message, url */ | |
| 54 | int subtype; /* message, ack, or cancel */ | |
| 55 | ||
| 56 | int direction; | |
| 57 | time_t time; | |
| 58 | ||
| 59 | icq_Packet *(*createPacket)(struct icq_Event_s *, icq_TCPLink *); | |
| 60 | void *(*parsePacket)(struct icq_Event_s *, icq_Packet *); | |
| 61 | void (*handleEvent)(struct icq_Event_s *, icq_Link *); | |
| 62 | ||
| 63 | #ifdef EVENT_DEBUG | |
| 64 | const char *(*eventName)(struct icq_Event_s *); | |
| 65 | const char *(*eventDump)(struct icq_Event_s *); | |
| 66 | #endif | |
| 67 | ||
| 68 | } icq_Event; | |
| 69 | ||
| 70 | typedef struct icq_MessageEvent_s { | |
| 71 | ||
| 72 | icq_Event event; | |
| 73 | ||
| 74 | char *message; /* must be non-const for url hack */ | |
| 75 | char *url; /* hack so we can use same structure for url */ | |
| 76 | int status; | |
| 77 | int type; | |
| 78 | ||
| 79 | } icq_MessageEvent; | |
| 80 | ||
| 81 | typedef struct icq_MessageEvent_s icq_URLEvent; | |
| 82 | ||
| 83 | typedef struct icq_ChatRequestEvent_s { | |
| 84 | ||
| 85 | icq_MessageEvent message_event; | |
| 86 | ||
| 87 | int port; | |
| 88 | ||
| 89 | } icq_ChatRequestEvent; | |
| 90 | ||
| 91 | typedef struct icq_FileRequestEvent_s { | |
| 92 | ||
| 93 | icq_MessageEvent message_event; | |
| 94 | ||
| 95 | const char *filename; | |
| 96 | unsigned long filesize; | |
| 97 | int port; | |
| 98 | ||
| 99 | } icq_FileRequestEvent; | |
| 100 | ||
| 101 | /* generic event functions */ | |
| 102 | void icq_EventInit(icq_Event *p, int type, int subtype, unsigned long uin, | |
| 103 | int version); | |
| 104 | icq_Packet *icq_EventCreatePacket(icq_Event *pbase); | |
| 105 | void icq_EventParsePacket(icq_Event *pevent, icq_Packet *p); | |
| 106 | ||
| 107 | /* message event functions */ | |
| 108 | icq_MessageEvent *icq_CreateMessageEvent(int subtype, unsigned long uin, | |
| 109 | const char *message); | |
| 110 | void icq_MessageEventInit(icq_MessageEvent *p, int type, int subtype, | |
| 111 | unsigned long uin, int msgtype, const char *message); | |
| 112 | icq_Packet *icq_MessageCreatePacket(icq_Event *pbase, icq_TCPLink *plink); | |
| 113 | void icq_MessageParsePacket(icq_Event *pbase, icq_Packet *p); | |
| 114 | ||
| 115 | /* url event functions */ | |
| 116 | icq_URLEvent *icq_CreateURLEvent(int subtype, unsigned long uin, | |
| 117 | const char *message, const char *url); | |
| 118 | icq_Packet *icq_URLCreatePacket(icq_Event *pbase, icq_TCPLink *plink); | |
| 119 | void icq_URLParsePacket(icq_Event *pbase, icq_Packet *p); | |
| 120 | ||
| 121 | /* chat request event functions */ | |
| 122 | icq_ChatRequestEvent *icq_ChatRequestEventNew(int subtype, | |
| 123 | unsigned long uin, const char *message, int port); | |
| 124 | icq_Packet *icq_ChatRequestCreatePacket(icq_Event *pbase, | |
| 125 | icq_TCPLink *plink); | |
| 126 | void icq_ChatParsePacket(icq_Event *pbase, icq_Packet *p); | |
| 127 | ||
| 128 | /* file request event functions */ | |
| 129 | icq_FileRequestEvent *icq_FileRequestEventNew(int subtype, | |
| 130 | unsigned long uin, const char *message, const char *filename, | |
| 131 | unsigned long filesize); | |
| 132 | icq_Packet *icq_FileRequestCreatePacket(icq_Event *pbase, | |
| 133 | icq_TCPLink *plink); | |
| 134 | void icq_FileParsePacket(icq_Event *pbase, icq_Packet *p); | |
| 135 | ||
| 136 | /* main packet parser */ | |
| 137 | icq_Event *icq_ParsePacket(icq_Packet *p); | |
| 138 | ||
| 139 | #ifdef EVENT_DEBUG | |
| 140 | const char *icq_MessageEventName(icq_Event *p); | |
| 141 | const char *icq_MessageEventDump(icq_Event *p); | |
| 142 | const char *icq_URLEventName(icq_Event *p); | |
| 143 | const char *icq_URLEventDump(icq_Event *p); | |
| 144 | const char *icq_ChatRequestEventName(icq_Event *p); | |
| 145 | const char *icq_ChatRequestEventDump(icq_Event *p); | |
| 146 | const char *icq_FileRequestEventName(icq_Event *p); | |
| 147 | const char *icq_FileRequestEventDump(icq_Event *p); | |
| 148 | const char *icq_EventDump(icq_Event *p); | |
| 149 | #endif | |
| 150 | ||
| 151 | #endif /* _ICQEVENT_H */ |