2 * @file yahoo_friend.h The Yahoo! protocol plugin YahooFriend object
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef _YAHOO_FRIEND_H_
26 #define _YAHOO_FRIEND_H_
29 #include "yahoo_packet.h"
32 YAHOO_PRESENCE_DEFAULT
= 0,
33 YAHOO_PRESENCE_ONLINE
,
34 YAHOO_PRESENCE_PERM_OFFLINE
35 } YahooPresenceVisibility
;
38 YAHOO_P2PSTATUS_NOT_CONNECTED
= 0,
39 YAHOO_P2PSTATUS_DO_NOT_CONNECT
,
40 YAHOO_P2PSTATUS_WE_ARE_SERVER
,
41 YAHOO_P2PSTATUS_WE_ARE_CLIENT
45 /* these are called friends instead of buddies mainly so I can use variables
46 * named f and not confuse them with variables named b
48 typedef struct _YahooFriend
{
49 enum yahoo_status status
;
56 gboolean bicon_sent_request
;
57 YahooPresenceVisibility presence
;
59 YahooPersonalDetails ypd
;
60 YahooP2PStatus p2p_status
;
61 gboolean p2p_packet_sent
; /* 0:not sent, 1=sent */
62 gint session_id
; /* session id of friend */
65 YahooFriend
*yahoo_friend_find(PurpleConnection
*gc
, const char *name
);
66 YahooFriend
*yahoo_friend_find_or_new(PurpleConnection
*gc
, const char *name
);
68 void yahoo_friend_set_ip(YahooFriend
*f
, const char *ip
);
69 const char *yahoo_friend_get_ip(YahooFriend
*f
);
71 void yahoo_friend_set_game(YahooFriend
*f
, const char *game
);
72 const char *yahoo_friend_get_game(YahooFriend
*f
);
74 void yahoo_friend_set_status_message(YahooFriend
*f
, char *msg
);
75 const char *yahoo_friend_get_status_message(YahooFriend
*f
);
77 void yahoo_friend_set_alias_id(YahooFriend
*f
, const char *alias_id
);
78 const char *yahoo_friend_get_alias_id(YahooFriend
*f
);
80 void yahoo_friend_set_buddy_icon_need_request(YahooFriend
*f
, gboolean needs
);
81 gboolean
yahoo_friend_get_buddy_icon_need_request(YahooFriend
*f
);
83 void yahoo_friend_free(gpointer p
);
85 void yahoo_process_presence(PurpleConnection
*gc
, struct yahoo_packet
*pkt
);
86 void yahoo_friend_update_presence(PurpleConnection
*gc
, const char *name
,
87 YahooPresenceVisibility presence
);
89 void yahoo_friend_set_p2p_status(YahooFriend
*f
, YahooP2PStatus p2p_status
);
90 YahooP2PStatus
yahoo_friend_get_p2p_status(YahooFriend
*f
);
92 #endif /* _YAHOO_FRIEND_H_ */