Frameworks/libpurple.framework/Versions/0.6.2/Headers/ycht.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 1739 Frameworks/libpurple.framework/Versions/0.6.0/Headers/ycht.h@8b0daad9656c
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
Evan@653
     1
/**
Evan@653
     2
 * @file ycht.h The Yahoo! protocol plugin, YCHT protocol stuff.
Evan@653
     3
 *
Evan@653
     4
 * purple
Evan@653
     5
 *
Evan@653
     6
 * Copyright (C) 2004 Timothy Ringenbach <omarvo@hotmail.com>
Evan@653
     7
 *
Evan@653
     8
 * Purple is the legal property of its developers, whose names are too numerous
Evan@653
     9
 * to list here.  Please refer to the COPYRIGHT file distributed with this
Evan@653
    10
 * source distribution.
Evan@653
    11
 *
Evan@653
    12
 * This program is free software; you can redistribute it and/or modify
Evan@653
    13
 * it under the terms of the GNU General Public License as published by
Evan@653
    14
 * the Free Software Foundation; either version 2 of the License, or
Evan@653
    15
 * (at your option) any later version.
Evan@653
    16
 *
Evan@653
    17
 * This program is distributed in the hope that it will be useful,
Evan@653
    18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Evan@653
    19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Evan@653
    20
 * GNU General Public License for more details.
Evan@653
    21
 *
Evan@653
    22
 * You should have received a copy of the GNU General Public License
Evan@653
    23
 * along with this program; if not, write to the Free Software
Evan@653
    24
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
Evan@653
    25
 */
Evan@653
    26
Evan@653
    27
#ifndef _PURPLE_YCHT_H_
Evan@653
    28
#define _PURPLE_YCHT_H_
Evan@653
    29
Evan@653
    30
/* #define YAHOO_YCHT_DEBUG */
Evan@653
    31
Evan@653
    32
#define YAHOO_YCHT_HOST "jcs3.chat.dcn.yahoo.com"
Evan@653
    33
#define YAHOO_YCHT_PORT 8002
Evan@653
    34
Evan@653
    35
#define YCHT_VERSION (0xae)
Evan@653
    36
#define YCHT_HEADER_LEN (0x10)
Evan@653
    37
Evan@653
    38
typedef enum {
Evan@653
    39
	YCHT_SERVICE_LOGIN = 0x01,
Evan@653
    40
	YCHT_SERVICE_LOGOUT = 0x02,
Evan@653
    41
	YCHT_SERVICE_CHATJOIN = 0x11,
Evan@653
    42
	YCHT_SERVICE_CHATPART = 0x12,
Evan@653
    43
	YCHT_SERVICE_CHATMSG = 0x41,
Evan@653
    44
	YCHT_SERVICE_CHATMSG_EMOTE = 0x43,
Evan@653
    45
	YCHT_SERVICE_PING = 0x62,
Evan@653
    46
	YCHT_SERVICE_ONLINE_FRIENDS = 0x68
Evan@653
    47
} ycht_service;
Evan@653
    48
/*
Evan@653
    49
yahoo: YCHT Service: 0x11 Version: 0x100
Evan@653
    50
yahoo: Data[0]: Linux, FreeBSD, Solaris:1
Evan@653
    51
yahoo: Data[1]: Questions, problems and discussions about all flavors of Unix.
Evan@653
    52
yahoo: Data[2]:
Evan@653
    53
yahoo: Data[3]: 0
Evan@653
    54
yahoo: Data[4]: sgooki888\0020\002 \0022769036\00258936\002
Evan@653
    55
yahoo: --==End of incoming YCHT packet==--
Evan@653
    56
Evan@653
    57
yahoo: --==Incoming YCHT packet==--
Evan@653
    58
yahoo: YCHT Service: 0x12 Version: 0x100
Evan@653
    59
yahoo: Data[0]: Linux, FreeBSD, Solaris:1
Evan@653
    60
yahoo: Data[1]: cccc4cccc
Evan@653
    61
yahoo: --==End of incoming YCHT packet==--
Evan@653
    62
Evan@653
    63
*/
Evan@653
    64
#define YCHT_SEP "\xc0\x80"
Evan@653
    65
Evan@653
    66
typedef struct _YchtConn {
Evan@653
    67
	PurpleConnection *gc;
Evan@653
    68
	gchar *room;
Evan@653
    69
	int room_id;
Evan@653
    70
	gint fd;
Evan@653
    71
	gint inpa;
Evan@653
    72
	gboolean logged_in;
Evan@653
    73
	gboolean changing_rooms;
Evan@653
    74
	guchar *rxqueue;
Evan@653
    75
	guint rxlen;
Evan@653
    76
	PurpleCircBuffer *txbuf;
Evan@653
    77
	guint tx_handler;
Evan@653
    78
} YchtConn;
Evan@653
    79
Evan@653
    80
typedef struct {
Evan@653
    81
	guint version;
Evan@653
    82
	guint service;
Evan@653
    83
	gint status;
Evan@653
    84
	GList *data;
Evan@653
    85
} YchtPkt;
Evan@653
    86
Evan@653
    87
void ycht_connection_open(PurpleConnection *gc);
Evan@653
    88
void ycht_connection_close(YchtConn *ycht);
Evan@653
    89
Evan@653
    90
void ycht_chat_join(YchtConn *ycht, const char *room);
Evan@653
    91
int ycht_chat_send(YchtConn *ycht, const char *room, const char *what);
Evan@653
    92
void ycht_chat_leave(YchtConn *ycht, const char *room, gboolean logout);
Evan@653
    93
void ycht_chat_send_invite(YchtConn *ycht, const char *room, const char *buddy, const char *msg);
Evan@653
    94
void ycht_chat_goto_user(YchtConn *ycht, const char *name);
Evan@653
    95
void ycht_chat_send_keepalive(YchtConn *ycht);
Evan@653
    96
Evan@653
    97
#endif /* _PURPLE_YCHT_H_ */