| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 */ |
21 */ |
| 22 |
22 |
| 23 #ifndef _YAHOO_H_ |
23 #ifndef _YAHOO_H_ |
| 24 #define _YAHOO_H_ |
24 #define _YAHOO_H_ |
| |
25 |
| |
26 #include "prpl.h" |
| 25 |
27 |
| 26 enum yahoo_service { /* these are easier to see in hex */ |
28 enum yahoo_service { /* these are easier to see in hex */ |
| 27 YAHOO_SERVICE_LOGON = 1, |
29 YAHOO_SERVICE_LOGON = 1, |
| 28 YAHOO_SERVICE_LOGOFF, |
30 YAHOO_SERVICE_LOGOFF, |
| 29 YAHOO_SERVICE_ISAWAY, |
31 YAHOO_SERVICE_ISAWAY, |
| 98 YAHOO_STATUS_CUSTOM = 99, |
100 YAHOO_STATUS_CUSTOM = 99, |
| 99 YAHOO_STATUS_IDLE = 999, |
101 YAHOO_STATUS_IDLE = 999, |
| 100 YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */ |
102 YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */ |
| 101 YAHOO_STATUS_TYPING = 0x16 |
103 YAHOO_STATUS_TYPING = 0x16 |
| 102 }; |
104 }; |
| 103 #define YAHOO_STATUS_GAME 0x2 /* Games don't fit into the regular status model */ |
|
| 104 |
105 |
| 105 struct yahoo_data { |
106 struct yahoo_data { |
| 106 int fd; |
107 int fd; |
| 107 guchar *rxqueue; |
108 guchar *rxqueue; |
| 108 int rxlen; |
109 int rxlen; |
| 109 GHashTable *hash; |
110 GHashTable *friends; |
| 110 GHashTable *games; |
|
| 111 int current_status; |
111 int current_status; |
| 112 gboolean logged_in; |
112 gboolean logged_in; |
| |
113 GString *tmp_serv_blist, *tmp_serv_ilist; |
| 113 GSList *confs; |
114 GSList *confs; |
| 114 unsigned int conf_id; /* just a counter */ |
115 unsigned int conf_id; /* just a counter */ |
| 115 gboolean chat_online; |
116 gboolean chat_online; |
| 116 gboolean in_chat; |
117 gboolean in_chat; |
| 117 char *chat_name; |
118 char *chat_name; |
| 127 guint32 status; |
128 guint32 status; |
| 128 guint32 id; |
129 guint32 id; |
| 129 GSList *hash; |
130 GSList *hash; |
| 130 }; |
131 }; |
| 131 |
132 |
| |
133 struct yahoo_friend { /* we'll call them friends, so we don't confuse them with GaimBuddy */ |
| |
134 enum yahoo_status status; |
| |
135 char *msg; |
| |
136 char *game; |
| |
137 int idle; |
| |
138 int away; |
| |
139 gboolean sms; |
| |
140 }; |
| |
141 |
| 132 struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id); |
142 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); |
143 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); |
144 int yahoo_send_packet(struct yahoo_data *yd, struct yahoo_packet *pkt); |
| 135 void yahoo_packet_free(struct yahoo_packet *pkt); |
145 void yahoo_packet_free(struct yahoo_packet *pkt); |
| 136 |
146 |