Wed, 03 Sep 2003 12:45:17 +0000
[gaim-migrate @ 7256]
Tim Ringenbach (marv_sf) writes:
" This adds Chat and Conference support to the Yahoo! prpl.
I think I got all the major bugs out, and it works
pretty good.
You can invite others, and accept inventations for both
chats and conferences, you can join a chat from the
Buddies menu in the buddy list, like you would for irc,
and you can initiate a conference by right clicking on
a buddy, like you would for msn. You can also attempt
to join user in chat, which will fail if they're not
actually in a chat. (Apparently the offical version
can't tell before hand either.)
Oh, and you can chat."
committer: Luke Schierer <lschiere@pidgin.im>
| 6513 | 1 | /** |
| 2 | * @file yahoo.h The Yahoo! protocol plugin | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 6 | * Copyright (C) 2003 | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | */ | |
| 22 | ||
| 23 | #ifndef _YAHOO_H_ | |
| 24 | #define _YAHOO_H_ | |
| 25 | ||
| 6729 | 26 | enum yahoo_service { /* these are easier to see in hex */ |
| 27 | YAHOO_SERVICE_LOGON = 1, | |
| 28 | YAHOO_SERVICE_LOGOFF, | |
| 29 | YAHOO_SERVICE_ISAWAY, | |
| 30 | YAHOO_SERVICE_ISBACK, | |
| 31 | YAHOO_SERVICE_IDLE, /* 5 (placemarker) */ | |
| 32 | YAHOO_SERVICE_MESSAGE, | |
| 33 | YAHOO_SERVICE_IDACT, | |
| 34 | YAHOO_SERVICE_IDDEACT, | |
| 35 | YAHOO_SERVICE_MAILSTAT, | |
| 36 | YAHOO_SERVICE_USERSTAT, /* 0xa */ | |
| 37 | YAHOO_SERVICE_NEWMAIL, | |
| 38 | YAHOO_SERVICE_CHATINVITE, | |
| 39 | YAHOO_SERVICE_CALENDAR, | |
| 40 | YAHOO_SERVICE_NEWPERSONALMAIL, | |
| 41 | YAHOO_SERVICE_NEWCONTACT, | |
| 42 | YAHOO_SERVICE_ADDIDENT, /* 0x10 */ | |
| 43 | YAHOO_SERVICE_ADDIGNORE, | |
| 44 | YAHOO_SERVICE_PING, | |
| 45 | YAHOO_SERVICE_GOTGROUPRENAME, | |
| 46 | YAHOO_SERVICE_SYSMESSAGE = 0x14, | |
| 47 | YAHOO_SERVICE_PASSTHROUGH2 = 0x16, | |
| 48 | YAHOO_SERVICE_CONFINVITE = 0x18, | |
| 49 | YAHOO_SERVICE_CONFLOGON, | |
| 50 | YAHOO_SERVICE_CONFDECLINE, | |
| 51 | YAHOO_SERVICE_CONFLOGOFF, | |
| 52 | YAHOO_SERVICE_CONFADDINVITE, | |
| 53 | YAHOO_SERVICE_CONFMSG, | |
| 54 | YAHOO_SERVICE_CHATLOGON, | |
| 55 | YAHOO_SERVICE_CHATLOGOFF, | |
| 56 | YAHOO_SERVICE_CHATMSG = 0x20, | |
| 57 | YAHOO_SERVICE_GAMELOGON = 0x28, | |
| 58 | YAHOO_SERVICE_GAMELOGOFF, | |
| 59 | YAHOO_SERVICE_GAMEMSG = 0x2a, | |
| 60 | YAHOO_SERVICE_FILETRANSFER = 0x46, | |
| 61 | YAHOO_SERVICE_VOICECHAT = 0x4A, | |
| 62 | YAHOO_SERVICE_NOTIFY = 0x4B, | |
| 63 | YAHOO_SERVICE_VERIFY, | |
| 64 | YAHOO_SERVICE_P2PFILEXFER, | |
| 65 | YAHOO_SERVICE_PEEPTOPEER = 0x4F, | |
| 66 | YAHOO_SERVICE_WEBCAM, | |
| 67 | YAHOO_SERVICE_AUTHRESP = 0x54, | |
| 68 | YAHOO_SERVICE_LIST = 0x55, | |
| 69 | YAHOO_SERVICE_AUTH = 0x57, | |
| 70 | YAHOO_SERVICE_ADDBUDDY = 0x83, | |
| 71 | YAHOO_SERVICE_REMBUDDY = 0x84, | |
| 72 | YAHOO_SERVICE_IGNORECONTACT, /* > 1, 7, 13 < 1, 66, 13, 0*/ | |
| 73 | YAHOO_SERVICE_REJECTCONTACT, | |
| 74 | YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */ | |
| 75 | YAHOO_SERVICE_CHATONLINE = 0x96, /* > 109(id), 1, 6(abcde) < 0,1*/ | |
| 76 | YAHOO_SERVICE_CHATGOTO, | |
| 77 | YAHOO_SERVICE_CHATJOIN, /* > 1 104-room 129-1600326591 62-2 */ | |
| 78 | YAHOO_SERVICE_CHATLEAVE, | |
| 79 | YAHOO_SERVICE_CHATEXIT = 0x9b, | |
| 80 | YAHOO_SERVICE_CHATADDINVITE = 0x9d, | |
| 81 | YAHOO_SERVICE_CHATLOGOUT = 0xa0, | |
| 82 | YAHOO_SERVICE_CHATPING, | |
| 83 | YAHOO_SERVICE_COMMENT = 0xa8 | |
| 84 | }; | |
| 6513 | 85 | |
| 6729 | 86 | enum yahoo_status { |
| 87 | YAHOO_STATUS_AVAILABLE = 0, | |
| 88 | YAHOO_STATUS_BRB, | |
| 89 | YAHOO_STATUS_BUSY, | |
| 90 | YAHOO_STATUS_NOTATHOME, | |
| 91 | YAHOO_STATUS_NOTATDESK, | |
| 92 | YAHOO_STATUS_NOTINOFFICE, | |
| 93 | YAHOO_STATUS_ONPHONE, | |
| 94 | YAHOO_STATUS_ONVACATION, | |
| 95 | YAHOO_STATUS_OUTTOLUNCH, | |
| 96 | YAHOO_STATUS_STEPPEDOUT, | |
| 97 | YAHOO_STATUS_INVISIBLE = 12, | |
| 98 | YAHOO_STATUS_CUSTOM = 99, | |
| 99 | YAHOO_STATUS_IDLE = 999, | |
| 100 | YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */ | |
| 101 | YAHOO_STATUS_TYPING = 0x16 | |
| 102 | }; | |
| 103 | #define YAHOO_STATUS_GAME 0x2 /* Games don't fit into the regular status model */ | |
| 104 | ||
| 105 | struct yahoo_data { | |
| 106 | int fd; | |
| 107 | guchar *rxqueue; | |
| 108 | int rxlen; | |
| 109 | GHashTable *hash; | |
| 110 | GHashTable *games; | |
| 111 | int current_status; | |
| 112 | gboolean logged_in; | |
| 113 | GSList *confs; | |
| 114 | unsigned int conf_id; /* just a counter */ | |
| 115 | gboolean chat_online; | |
| 116 | gboolean in_chat; | |
| 117 | char *chat_name; | |
| 118 | }; | |
| 119 | ||
| 120 | struct yahoo_pair { | |
| 121 | int key; | |
| 122 | char *value; | |
| 123 | }; | |
| 124 | ||
| 125 | struct yahoo_packet { | |
| 126 | guint16 service; | |
| 127 | guint32 status; | |
| 128 | guint32 id; | |
| 129 | GSList *hash; | |
| 130 | }; | |
| 131 | ||
| 132 | struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id); | |
| 133 | void yahoo_packet_hash(struct yahoo_packet *pkt, int key, const char *value); | |
| 134 | int yahoo_send_packet(struct yahoo_data *yd, struct yahoo_packet *pkt); | |
| 135 | void yahoo_packet_free(struct yahoo_packet *pkt); | |
| 136 | ||
| 137 | /* util.c */ | |
| 6513 | 138 | void yahoo_init_colorht(); |
| 139 | void yahoo_dest_colorht(); | |
| 6629 | 140 | char *yahoo_codes_to_html(const char *x); |
| 141 | char *yahoo_html_to_codes(const char *src); | |
| 6513 | 142 | |
| 143 | #endif /* _YAHOO_H_ */ |