libpurple/protocols/facebook/util.h

Wed, 19 Aug 2015 21:50:10 -0400

author
James Geboski <jgeboski@gmail.com>
date
Wed, 19 Aug 2015 21:50:10 -0400
branch
facebook
changeset 37364
d8e50d403e82
parent 37359
79374d83fae5
child 37414
252bb96afbe0
permissions
-rw-r--r--

facebook: display images in-line

37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
1 /* purple
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
2 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
5 * source distribution.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
6 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
10 * (at your option) any later version.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
11 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
15 * GNU General Public License for more details.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
16 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
20 */
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
21
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
22 #ifndef _FACEBOOK_UTIL_H_
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
23 #define _FACEBOOK_UTIL_H_
3f5570a17b15 facebook: initial import of bitlbee-facebook
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: 37317
diff changeset
25 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
26 * SECTION:util
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
27 * @section_id: facebook-util
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
28 * @short_description: <filename>util.h</filename>
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
29 * @title: General Utilities
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
30 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
31 * The general utilities.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
32 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
33
37309
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37289
diff changeset
34 #include <glib.h>
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37289
diff changeset
35
37310
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
36 #include <libpurple/util.h>
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
37
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
38 #include "account.h"
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
39 #include "conversationtypes.h"
a1a5f0ac39f2 facebook: cleaned up libpurple includes
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
40 #include "debug.h"
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
41 #include "connection.h"
37317
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
42 #include "conversation.h"
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
43
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
44 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
45 * FB_UTIL_DEBUG_INFO:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
46 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
47 * Shortcut #PurpleDebugLevel for unsafe and verbose info messages.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
48 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
49 #define FB_UTIL_DEBUG_INFO ( \
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
50 PURPLE_DEBUG_INFO | \
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
51 FB_UTIL_DEBUG_FLAG_UNSAFE | \
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
52 FB_UTIL_DEBUG_FLAG_VERBOSE \
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
53 )
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
54
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
55 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
56 * FB_UTIL_ERROR:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
57 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
58 * The #GQuark of the domain of utility errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
59 */
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
60 #define FB_UTIL_ERROR fb_util_error_quark()
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
61
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
62 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
63 * FbUtilRequestBuddyFunc:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
64 * @buddies: The list of #PurpleBuddy's.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
65 * @data: The user-defined data.
37358
fbb9041f0c01 facebook: added missing GTK-Doc description
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
66 *
fbb9041f0c01 facebook: added missing GTK-Doc description
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
67 * The callback for requested buddies.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
68 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
69 typedef void (*FbUtilRequestBuddyFunc) (GSList *buddies, gpointer data);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
70
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
71 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
72 * FbUtilDebugFlags:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
73 * @FB_UTIL_DEBUG_FLAG_UNSAFE: The message is unsafe.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
74 * @FB_UTIL_DEBUG_FLAG_VERBOSE: The message is verbose.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
75 * @FB_UTIL_DEBUG_FLAG_ALL: All of the flags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
76 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
77 * The debugging message flags. These flags are inserted on top of
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
78 * a #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
79 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
80 typedef enum
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
81 {
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37358
diff changeset
82 FB_UTIL_DEBUG_FLAG_UNSAFE = 1 << 25,
37289
fb6acaae2788 facebook: fixed broken logging from invalid level
James Geboski <jgeboski@gmail.com>
parents: 37284
diff changeset
83 FB_UTIL_DEBUG_FLAG_VERBOSE = 1 << 26,
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37358
diff changeset
84 FB_UTIL_DEBUG_FLAG_ALL = 3 << 25
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
85 } FbUtilDebugFlags;
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
86
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
87 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
88 * FbUtilError:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
89 * @FB_UTIL_ERROR_GENERAL: General failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
90 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
91 * The error codes for the #FB_UTIL_ERROR domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
92 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
93 typedef enum
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
94 {
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
95 FB_UTIL_ERROR_GENERAL
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
96 } FbUtilError;
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
97
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
98 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
99 * fb_util_error_quark:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
100 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
101 * Gets the #GQuark of the domain of utility errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
102 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
103 * Returns: The #GQuark of the domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
104 */
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
105 GQuark
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
106 fb_util_error_quark(void);
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
107
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
108 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
109 * fb_util_account_find_buddy:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
110 * @acct: The #PurpleAccount.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
111 * @chat: The #PurpleChatConversation.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
112 * @name: The name of the buddy.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
113 * @error: The return location for the #GError, or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
114 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
115 * Finds a buddy by their name or alias.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
116 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
117 * Returns: The #PurpleBuddy if found, otherwise #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
118 */
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
119 PurpleBuddy *
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
120 fb_util_account_find_buddy(PurpleAccount *acct, PurpleChatConversation *chat,
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
121 const gchar *name, GError **error);
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
122
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
123 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
124 * fb_util_debug:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
125 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
126 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
127 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
128 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
129 * Logs a debugging message. If the messages is unsafe or verbose,
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
130 * apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
131 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
132 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
133 fb_util_debug(PurpleDebugLevel level, const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
134 G_GNUC_PRINTF(2, 3);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
135
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
136 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
137 * fb_util_vdebug:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
138 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
139 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
140 * @ap: The #va_list.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
141 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
142 * Logs a debugging message. If the messages is unsafe or verbose,
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
143 * apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
144 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
145 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
146 fb_util_vdebug(PurpleDebugLevel level, const gchar *format, va_list ap);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
147
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
148 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
149 * fb_util_debug_misc:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
150 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
151 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
152 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
153 * Logs a debugging message with the level of #PURPLE_DEBUG_MISC.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
154 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
155 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
156 fb_util_debug_misc(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
157 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
158
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
159 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
160 * fb_util_debug_info:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
161 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
162 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
163 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
164 * Logs a debugging message with the level of #PURPLE_DEBUG_INFO.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
165 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
166 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
167 fb_util_debug_info(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
168 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
169
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
170 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
171 * fb_util_debug_warning:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
172 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
173 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
174 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
175 * Logs a debugging message with the level of #PURPLE_DEBUG_WARNING.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
176 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
177 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
178 fb_util_debug_warning(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
179 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
180
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
181 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
182 * fb_util_debug_error:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
183 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
184 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
185 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
186 * Logs a debugging message with the level of #PURPLE_DEBUG_ERROR.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
187 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
188 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
189 fb_util_debug_error(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
190 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
191
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
192 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
193 * fb_util_debug_fatal:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
194 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
195 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
196 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
197 * Logs a debugging message with the level of #PURPLE_DEBUG_FATAL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
198 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
199 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
200 fb_util_debug_fatal(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
201 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
202
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
203 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
204 * fb_util_debug_hexdump:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
205 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
206 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
207 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
208 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
209 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
210 * Logs a hexdump of a #GByteArray. If the messages is unsafe or
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
211 * verbose, apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
212 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
213 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
214 fb_util_debug_hexdump(PurpleDebugLevel level, const GByteArray *bytes,
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
215 const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
216 G_GNUC_PRINTF(3, 4);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
217
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
218 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
219 * fb_util_locale_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
220 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
221 * Gets the locale string (ex: en_US) from the system. The returned
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
222 * string should be freed with #g_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
223 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
224 * Returns: The locale string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
225 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
226 gchar *
37260
473934b0c408 facebook: use working locale language
James Geboski <jgeboski@gmail.com>
parents: 37258
diff changeset
227 fb_util_locale_str(void);
473934b0c408 facebook: use working locale language
James Geboski <jgeboski@gmail.com>
parents: 37258
diff changeset
228
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
229 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
230 * fb_util_randstr:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
231 * @size: The size of the string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
232 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
233 * Gets a random alphanumeric string. The returned string should be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
234 * freed with #g_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
235 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
236 * Returns: The random string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
237 */
37260
473934b0c408 facebook: use working locale language
James Geboski <jgeboski@gmail.com>
parents: 37258
diff changeset
238 gchar *
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
239 fb_util_randstr(gsize size);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
240
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
241 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
242 * fb_util_request_buddy:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
243 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
244 * @title: The title of the message or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
245 * @primary: The main point of the message or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
246 * @secondary: The secondary information or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
247 * @select: A #GSList of selected buddies, or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
248 * @multi: #TRUE to for multiple buddy selections, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
249 * @ok_cb: The callback for the `OK` button or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
250 * @cancel_cb: The callback for the `Cancel` button or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
251 * @data: The user-defined data.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
252 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
253 * Displays a buddy list selection form.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
254 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
255 * Returns: The UI-specific handle.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
256 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
257 gpointer
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
258 fb_util_request_buddy(PurpleConnection *gc, const gchar *title,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
259 const gchar *primary, const gchar *secondary,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
260 GSList *select, gboolean multi, GCallback ok_cb,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
261 GCallback cancel_cb, gpointer data);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
262
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
263 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
264 * fb_util_serv_got_im:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
265 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
266 * @who: The message sender or receiver.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
267 * @text: The message text.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
268 * @flags: The #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
269 * @timestamp: The message timestamp.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
270 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
271 * Handles an incoming IM message. This function is special in that it
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
272 * handles self messages. This function determines the direction of the
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
273 * message from the #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
274 */
37317
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
275 void
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
276 fb_util_serv_got_im(PurpleConnection *gc, const gchar *who, const gchar *text,
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
277 PurpleMessageFlags flags, guint64 timestamp);
143a4d8db15c facebook: implemented self messages
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: 37317
diff changeset
279 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
280 * fb_util_serv_got_chat_in:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
281 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
282 * @id: The id of the chat.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
283 * @who: The message sender or receiver.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
284 * @text: The message text.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
285 * @flags: The #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
286 * @timestamp: The message timestamp.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
287 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
288 * Handles an incoming chat message. This function is special in that
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
289 * it handles self messages. This function determines the direction of
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
290 * the message from the #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
291 */
37317
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
292 void
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
293 fb_util_serv_got_chat_in(PurpleConnection *gc, gint id, const gchar *who,
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
294 const gchar *text, PurpleMessageFlags flags,
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
295 guint64 timestamp);
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
296
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
297 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
298 * fb_util_str_is:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
299 * @str: The string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
300 * @type: The #GAsciiType.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
301 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
302 * Determines if @str abides to the #GAsciiType.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
303 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
304 * Returns: #TRUE if the string abides to @type, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
305 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
306 gboolean
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
307 fb_util_str_is(const gchar *str, GAsciiType type);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
308
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
309 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
310 * fb_util_zcompressed:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
311 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
312 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
313 * Determines if the #GByteArray is zlib compressed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
314 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
315 * Returns: #TRUE if the #GByteArray is compressed, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
316 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
317 gboolean
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
318 fb_util_zcompressed(const GByteArray *bytes);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
319
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
320 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
321 * fb_util_zcompress:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
322 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
323 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
324 * Compresses a #GByteArray with zlib. The returned #GByteArray should
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
325 * be freed with #g_byte_array_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
326 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
327 * Returns: The compressed #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
328 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
329 GByteArray *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
330 fb_util_zcompress(const GByteArray *bytes);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
331
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
332 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
333 * fb_util_zuncompress:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
334 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
335 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
336 * Uncompresses a #GByteArray with zlib. The returned #GByteArray
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
337 * should be freed with #g_byte_array_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
338 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
339 * Returns: The uncompressed #GByteArray, or #NULL on error.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
340 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
341 GByteArray *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
342 fb_util_zuncompress(const GByteArray *bytes);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
343
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
344 #endif /* _FACEBOOK_UTIL_H_ */

mercurial