annotate src/protocols/yahoo/ycht.h @ 9583:91c9e060111b

[gaim-migrate @ 10426] " This patch provides a configuration page for the Buddy State Notification plugin, allowing you to select whether you want to be notified of buddy Away, Idle or both. The motivation for this is that clients such as Trillian report idle times of 1 minute, leading to lots of idle notifications, when only aways are really of any interest." --Alan Ford Date: 2004-06-06 00:03 Sender: deryni9 Logged In: YES user_id=516184 This should probably be made to use the new plugin pref stuff so that it doesn't add a dependency on gtk for no real reason. Date: 2004-06-27 13:24 Sender: ajf101 Logged In: YES user_id=1028264 Yes, you're quite right. I've got around to updating it now to use this new stuff, see the updated patch. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 24 Jul 2004 15:14:43 +0000
parents 3aa848ccf986
children f4e58e94ced3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9376
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
1 /**
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
2 * @file ycht.h The Yahoo! protocol plugin, YCHT protocol stuff.
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
3 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
4 * gaim
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
5 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
6 * Copyright (C) 2004 Timothy Ringenbach <omarvo@hotmail.com>
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
7 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
8 * Gaim is the legal property of its developers, whose names are too numerous
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
10 * source distribution.
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
11 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
16 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
21 *
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
25 */
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
26
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
27 #ifndef _GAIM_YCHT_H_
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
28 #define _GAIM_YCHT_H_
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
29
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
30 /* #define YAHOO_YCHT_DEBUG */
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
31
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
32 #define YAHOO_YCHT_HOST "jcs3.chat.dcn.yahoo.com"
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
33 #define YAHOO_YCHT_PORT 8002
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
34
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
35 #define YCHT_VERSION (0xae)
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
36 #define YCHT_HEADER_LEN (0x10)
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
37
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
38 typedef enum {
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
39 YCHT_SERVICE_LOGIN = 0x01,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
40 YCHT_SERVICE_LOGOUT = 0x02,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
41 YCHT_SERVICE_CHATJOIN = 0x11,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
42 YCHT_SERVICE_CHATPART = 0x12,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
43 YCHT_SERVICE_CHATMSG = 0x41,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
44 YCHT_SERVICE_CHATMSG_EMOTE = 0x43,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
45 YCHT_SERVICE_PING = 0x62,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
46 YCHT_SERVICE_ONLINE_FRIENDS = 0x68,
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
47 } ycht_service;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
48 /*
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
49 yahoo: YCHT Service: 0x11 Version: 0x100
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
50 yahoo: Data[0]: Linux, FreeBSD, Solaris:1
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
51 yahoo: Data[1]: Questions, problems and discussions about all flavors of Unix.
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
52 yahoo: Data[2]:
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
53 yahoo: Data[3]: 0
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
54 yahoo: Data[4]: sgooki888\0020\002 \0022769036\00258936\002
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
55 yahoo: --==End of incoming YCHT packet==--
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
56
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
57 yahoo: --==Incoming YCHT packet==--
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
58 yahoo: YCHT Service: 0x12 Version: 0x100
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
59 yahoo: Data[0]: Linux, FreeBSD, Solaris:1
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
60 yahoo: Data[1]: cccc4cccc
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
61 yahoo: --==End of incoming YCHT packet==--
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
62
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
63 */
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
64 #define YCHT_SEP "\xc0\x80"
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
65
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
66 typedef struct _YchtConn {
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
67 GaimConnection *gc;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
68 gchar *room;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
69 int room_id;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
70 gint fd;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
71 gint inpa;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
72 gboolean logged_in;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
73 gboolean changing_rooms;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
74 guchar *rxqueue;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
75 guint rxlen;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
76 } YchtConn;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
77
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
78 typedef struct {
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
79 guint version;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
80 guint service;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
81 gint status;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
82 GList *data;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
83 } YchtPkt;
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
84
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
85
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
86 void ycht_connection_open(GaimConnection *gc);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
87 void ycht_connection_close(YchtConn *ycht);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
88
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
89 void ycht_chat_join(YchtConn *ycht, const char *room);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
90 int ycht_chat_send(YchtConn *ycht, const char *room, const char *what);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
91 void ycht_chat_leave(YchtConn *ycht, const char *room, gboolean logout);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
92 void ycht_chat_send_invite(YchtConn *ycht, const char *room, const char *buddy, const char *msg);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
93 void ycht_chat_goto_user(YchtConn *ycht, const char *name);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
94 void ycht_chat_send_keepalive(YchtConn *ycht);
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
95
3aa848ccf986 [gaim-migrate @ 10184]
Tim Ringenbach <marv@pidgin.im>
parents:
diff changeset
96 #endif /* _GAIM_YCHT_H_ */