Migrate certificates, icons, logs to XDG dirs
[pidgin-git.git] / libpurple / protocols / yahoo / yahoo_friend.h
blobf81f0e187d56917460ba28f656220478eaa89fd0
1 /**
2 * @file yahoo_friend.h The Yahoo! protocol plugin YahooFriend object
4 * purple
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
8 * source distribution.
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_
28 #include "ymsg.h"
29 #include "yahoo_packet.h"
31 typedef enum {
32 YAHOO_PRESENCE_DEFAULT = 0,
33 YAHOO_PRESENCE_ONLINE,
34 YAHOO_PRESENCE_PERM_OFFLINE
35 } YahooPresenceVisibility;
37 typedef enum {
38 YAHOO_P2PSTATUS_NOT_CONNECTED = 0,
39 YAHOO_P2PSTATUS_DO_NOT_CONNECT,
40 YAHOO_P2PSTATUS_WE_ARE_SERVER,
41 YAHOO_P2PSTATUS_WE_ARE_CLIENT
42 } YahooP2PStatus;
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;
50 gchar *msg;
51 gchar *game;
52 int idle;
53 int away;
54 gboolean sms;
55 gchar *ip;
56 gboolean bicon_sent_request;
57 YahooPresenceVisibility presence;
58 long int version_id;
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 */
63 } YahooFriend;
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_ */