libpurple/protocols/facebook/data.h

Tue, 27 Jun 2017 11:58:03 -0500

author
Mike Ruprecht <cmaiku@gmail.com>
date
Tue, 27 Jun 2017 11:58:03 -0500
changeset 38381
0f253504b9dd
parent 37948
2a8f41535c8f
child 39271
5fd417ab577b
permissions
-rw-r--r--

facebook: Fix reading MQTT ping responses

MQTT ping packets are only a two byte header with a zero length
content. The Gio port of this was coded such that packets with zero
length contents were considered to not have been fully received.
This caused the MQTT connection to get stuck after a ping response
was received and eventually timeout. Therefore, the connection
would "fail" and reconnect every 1.5 minutes or so.

This patch fixes this by reworking that logic to also accept fully
received packets with a zero length content.

37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
1 /* purple
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
2 *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
5 * source distribution.
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
6 *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
10 * (at your option) any later version.
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
11 *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
15 * GNU General Public License for more details.
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
16 *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
20 */
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
21
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
22 #ifndef _FACEBOOK_DATA_H_
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
23 #define _FACEBOOK_DATA_H_
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
24
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
25 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
26 * SECTION:data
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
27 * @section_id: facebook-data
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
28 * @short_description: <filename>data.h</filename>
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
29 * @title: Connection Data
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
30 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
31 * The Connection Data.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
32 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
33
37309
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37291
diff changeset
34 #include <glib.h>
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37291
diff changeset
35
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
36 #include "connection.h"
37310
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
37 #include "roomlist.h"
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
38
37338
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
39 #include "api.h"
37310
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
40 #include "http.h"
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
41 #include "id.h"
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
42
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37357
diff changeset
43 #define FB_TYPE_DATA (fb_data_get_type())
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37357
diff changeset
44 #define FB_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), FB_TYPE_DATA, FbData))
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37357
diff changeset
45 #define FB_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), FB_TYPE_DATA, FbDataClass))
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37357
diff changeset
46 #define FB_IS_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), FB_TYPE_DATA))
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
47 #define FB_IS_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FB_TYPE_DATA))
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37357
diff changeset
48 #define FB_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FB_TYPE_DATA, FbDataClass))
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
49
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
50 #define FB_TYPE_DATA_IMAGE (fb_data_image_get_type())
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
51 #define FB_DATA_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), FB_TYPE_DATA_IMAGE, FbDataImage))
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
52 #define FB_DATA_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), FB_TYPE_DATA_IMAGE, FbDataImageClass))
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
53 #define FB_IS_DATA_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), FB_TYPE_DATA_IMAGE))
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
54 #define FB_IS_DATA_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FB_TYPE_DATA_IMAGE))
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
55 #define FB_DATA_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FB_TYPE_DATA_IMAGE, FbDataImageClass))
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
56
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
57 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
58 * FB_DATA_ICON_MAX:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
59 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
60 * The maximum of number of concurrent icon fetches.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
61 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
62 #define FB_DATA_ICON_MAX 4
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
63
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
64 typedef struct _FbData FbData;
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
65 typedef struct _FbDataClass FbDataClass;
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
66 typedef struct _FbDataPrivate FbDataPrivate;
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
67 typedef struct _FbDataImage FbDataImage;
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
68 typedef struct _FbDataImageClass FbDataImageClass;
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
69 typedef struct _FbDataImagePrivate FbDataImagePrivate;
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
70
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
71 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
72 * FbDataImageFunc:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
73 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
74 * @error: The #GError or #NULL.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
75 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
76 * The callback for a fetched #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
77 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
78 typedef void (*FbDataImageFunc) (FbDataImage *img, GError *error);
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
79
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
80 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
81 * FbData:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
82 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
83 * Represents the connection data used by #FacebookProtocol.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
84 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
85 struct _FbData
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
86 {
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
87 /*< private >*/
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
88 GObject parent;
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
89 FbDataPrivate *priv;
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
90 };
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
91
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
92 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
93 * FbDataClass:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
94 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
95 * The base class for all #FbData's.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
96 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
97 struct _FbDataClass
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
98 {
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
99 /*< private >*/
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
100 GObjectClass parent_class;
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
101 };
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
102
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
103 /**
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
104 * FbDataImage:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
105 *
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
106 * Represents the data used for fetching images.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
107 */
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
108 struct _FbDataImage
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
109 {
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
110 /*< private >*/
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
111 GObject parent;
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
112 FbDataImagePrivate *priv;
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
113 };
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
114
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
115 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
116 * FbDataImageClass:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
117 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
118 * The base class for all #FbDataImage's.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
119 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
120 struct _FbDataImageClass
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
121 {
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
122 /*< private >*/
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
123 GObjectClass parent_class;
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
124 };
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
125
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
126 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
127 * fb_data_get_type:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
128 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
129 * Returns: The #GType for an #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
130 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
131 GType
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
132 fb_data_get_type(void);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
133
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
134 /**
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
135 * fb_data_image_get_type:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
136 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
137 * Returns: The #GType for an #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
138 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
139 GType
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
140 fb_data_image_get_type(void);
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
141
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
142 /**
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
143 * fb_data_new:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
144 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
145 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
146 * Creates a new #FbData. The returned #FbData should be freed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
147 * #g_object_unref() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
148 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
149 * Returns: The new #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
150 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
151 FbData *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
152 fb_data_new(PurpleConnection *gc);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
153
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
154 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
155 * fb_data_load:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
156 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
157 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
158 * Loads the internal data from the underlying #PurpleAccount.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
159 *
37473
9fd3018c170f facebook: trivial GTK-Doc fixes
James Geboski <jgeboski@gmail.com>
parents: 37364
diff changeset
160 * Return: #TRUE if all of the data was loaded, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
161 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
162 gboolean
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
163 fb_data_load(FbData *fata);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
164
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
165 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
166 * fb_data_save:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
167 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
168 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
169 * Saves the internal data to the underlying #PurpleAccount.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
170 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
171 void
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
172 fb_data_save(FbData *fata);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
173
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
174 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
175 * fb_data_add_timeout:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
176 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
177 * @name: The name of the timeout.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
178 * @interval: The time, in milliseconds, between calls to @func.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
179 * @func: The #GSourceFunc.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
180 * @data: The data passed to @func.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
181 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
182 * Adds a new callback timer. The callback is called repeatedly on the
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
183 * basis of @interval, until @func returns #FALSE. The timeout should
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
184 * be cleared with #fb_data_clear_timeout() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
185 */
37342
acae53caaff0 facebook: periodically refetch the contact list for updates
James Geboski <jgeboski@gmail.com>
parents: 37338
diff changeset
186 void
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
187 fb_data_add_timeout(FbData *fata, const gchar *name, guint interval,
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
188 GSourceFunc func, gpointer data);
37342
acae53caaff0 facebook: periodically refetch the contact list for updates
James Geboski <jgeboski@gmail.com>
parents: 37338
diff changeset
189
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
190 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
191 * fb_data_clear_timeout:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
192 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
193 * @name: The name of the timeout.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
194 * @remove: #TRUE to remove from the event loop, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
195 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
196 * Clears and removes a callback timer. The only time @remove should be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
197 * #FALSE, is when being called from a #GSourceFunc, which is returning
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
198 * #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
199 */
37342
acae53caaff0 facebook: periodically refetch the contact list for updates
James Geboski <jgeboski@gmail.com>
parents: 37338
diff changeset
200 void
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
201 fb_data_clear_timeout(FbData *fata, const gchar *name, gboolean remove);
37342
acae53caaff0 facebook: periodically refetch the contact list for updates
James Geboski <jgeboski@gmail.com>
parents: 37338
diff changeset
202
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
203 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
204 * fb_data_get_api:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
205 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
206 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
207 * Gets the #FbApi from the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
208 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
209 * Return: The #FbApi.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
210 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
211 FbApi *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
212 fb_data_get_api(FbData *fata);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
213
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
214 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
215 * fb_data_get_connection:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
216 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
217 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
218 * Gets the #PurpleConnection from the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
219 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
220 * Return: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
221 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
222 PurpleConnection *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
223 fb_data_get_connection(FbData *fata);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
224
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
225 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
226 * fb_data_get_roomlist:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
227 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
228 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
229 * Gets the #PurpleRoomlist from the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
230 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
231 * Return: The #PurpleRoomlist.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
232 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
233 PurpleRoomlist *
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
234 fb_data_get_roomlist(FbData *fata);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
235
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
236 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
237 * fb_data_get_unread:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
238 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
239 * @id: The #FbId.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
240 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
241 * Gets the unread state of an #FbId.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
242 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
243 * Return: #TRUE if the #FbId is unread, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
244 */
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
245 gboolean
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
246 fb_data_get_unread(FbData *fata, FbId id);
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
247
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
248 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
249 * fb_data_set_roomlist:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
250 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
251 * @list: The #PurpleRoomlist.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
252 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
253 * Sets the #PurpleRoomlist to the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
254 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
255 void
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
256 fb_data_set_roomlist(FbData *fata, PurpleRoomlist *list);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
257
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
258 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
259 * fb_data_set_unread:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
260 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
261 * @id: The #FbId.
37473
9fd3018c170f facebook: trivial GTK-Doc fixes
James Geboski <jgeboski@gmail.com>
parents: 37364
diff changeset
262 * @unread: #TRUE if the #FbId is unread, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
263 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
264 * Sets the unread state of an #FbId to the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
265 */
37338
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
266 void
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
267 fb_data_set_unread(FbData *fata, FbId id, gboolean unread);
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
268
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
269 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
270 * fb_data_add_message:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
271 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
272 * @msg: The #FbApiMessage.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
273 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
274 * Adds an #FbApiMessage to the #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
275 */
37343
3e818c95dfd9 facebook: mark as read only if the conversation is focused
James Geboski <jgeboski@gmail.com>
parents: 37342
diff changeset
276 void
37338
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
277 fb_data_add_message(FbData *fata, FbApiMessage *msg);
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
278
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
279 /**
37364
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
280 * fb_data_remove_message:
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
281 * @fata: The #FbData.
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
282 * @msg: The #FbApiMessage.
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
283 *
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
284 * Removes an #FbApiMessage from the #FbData.
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
285 */
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
286 void
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
287 fb_data_remove_message(FbData *fata, FbApiMessage *msg);
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
288
d8e50d403e82 facebook: display images in-line
James Geboski <jgeboski@gmail.com>
parents: 37361
diff changeset
289 /**
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
290 * fb_data_take_messages:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
291 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
292 * @uid: The user #FbId.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
293 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
294 * Gets a #GSList of messages by the user #FbId from the #FbData. The
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
295 * #FbApiMessage's are removed from the #FbData. The returned #GSList
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
296 * and its #FbApiMessage's should be freed with #fb_api_message_free()
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
297 * and #g_slist_free_full() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
298 */
37338
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
299 GSList *
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
300 fb_data_take_messages(FbData *fata, FbId uid);
e4d77bc25235 facebook: add and alias non-friend buddies
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
301
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
302 /**
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
303 * fb_data_image_add:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
304 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
305 * @url: The image URL.
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
306 * @func: The #FbDataImageFunc.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
307 * @data: The user-defined data.
37560
92885e0456ed facebook: fixed a crash with incoming messages from non-friends
James Geboski <jgeboski@gmail.com>
parents: 37473
diff changeset
308 * @dunc: The #GDestroyNotify for @data or #NULL.
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
309 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
310 * Adds a new #FbDataImage to the #FbData. This is used to fetch images
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
311 * from HTTP sources. After calling this, #fb_data_image_queue() should
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
312 * be called to queue the fetching process.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
313 *
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
314 * Return: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
315 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
316 FbDataImage *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
317 fb_data_image_add(FbData *fata, const gchar *url, FbDataImageFunc func,
37560
92885e0456ed facebook: fixed a crash with incoming messages from non-friends
James Geboski <jgeboski@gmail.com>
parents: 37473
diff changeset
318 gpointer data, GDestroyNotify dunc);
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
319
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
320 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
321 * fb_data_image_get_active:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
322 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
323 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
324 * Gets the active fetching state from the #FbDataImage.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
325 *
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
326 * Returns: #TRUE if the image is being fetched, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
327 */
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
328 gboolean
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
329 fb_data_image_get_active(FbDataImage *img);
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
330
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
331 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
332 * fb_data_image_get_data:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
333 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
334 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
335 * Gets the user-defined data from the #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
336 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
337 * Returns: The user-defined data.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
338 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
339 gpointer
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
340 fb_data_image_get_data(FbDataImage *img);
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
341
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
342 /**
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
343 * fb_data_image_get_fata:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
344 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
345 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
346 * Gets the #FbData from the #FbDataImage.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
347 *
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
348 * Returns: The #FbData.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
349 */
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
350 FbData *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
351 fb_data_image_get_fata(FbDataImage *img);
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
352
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
353 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
354 * fb_data_image_get_image:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
355 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
356 * @size: The return location for the image size or #NULL.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
357 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
358 * Gets the image data from the #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
359 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
360 * Returns: The image data.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
361 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
362 const guint8 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
363 fb_data_image_get_image(FbDataImage *img, gsize *size);
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
364
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
365 /**
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
366 * fb_data_image_dup_image:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
367 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
368 * @size: The return location for the image size or #NULL.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
369 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
370 * Gets the duplicated image data from the #FbDataImage. The returned
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
371 * data should be freed with #g_free() when no longer needed.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
372 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
373 * Returns: The duplicated image data.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
374 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
375 guint8 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
376 fb_data_image_dup_image(FbDataImage *img, gsize *size);
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
377
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
378 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
379 * fb_data_image_get_url:
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
380 * @img: The #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
381 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
382 * Gets the image URL from the #FbDataImage.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
383 *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
384 * Returns: The image URL.
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
385 */
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
386 const gchar *
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
387 fb_data_image_get_url(FbDataImage *img);
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
388
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
389 /**
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
390 * fb_data_image_queue:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
391 * @fata: The #FbData.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
392 *
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
393 * Queues the next #FbDataImage fetches.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37343
diff changeset
394 */
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
395 void
37361
6545b86a0705 facebook: refactored for future inline images
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
396 fb_data_image_queue(FbData *fata);
37276
853fadf2e250 facebook: queue icon downloads to prevent lag
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
397
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
398 #endif /* _FACEBOOK_DATA_H_ */

mercurial