libpurple/protocols/facebook/util.h

Fri, 01 May 2020 04:42:52 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 01 May 2020 04:42:52 -0500
changeset 40358
e6fe6fc1f516
parent 39819
3554dac2991b
child 41122
f29fa0dda4bf
permissions
-rw-r--r--

move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually

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
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37471
diff changeset
22 #ifndef PURPLE_FACEBOOK_UTIL_H
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37471
diff changeset
23 #define PURPLE_FACEBOOK_UTIL_H
37250
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
40358
e6fe6fc1f516 move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually
Gary Kramlich <grim@reaperworld.com>
parents: 39819
diff changeset
36 #include <purple.h>
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
37
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
38 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
39 * FB_UTIL_DEBUG_INFO:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
40 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
41 * 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
42 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
43 #define FB_UTIL_DEBUG_INFO ( \
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
44 PURPLE_DEBUG_INFO | \
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
45 FB_UTIL_DEBUG_FLAG_UNSAFE | \
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
46 FB_UTIL_DEBUG_FLAG_VERBOSE \
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
47 )
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
48
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
49 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
50 * FB_UTIL_ERROR:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
51 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
52 * 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
53 */
37471
32c1e77d0474 facebook: coding style consistencies
James Geboski <jgeboski@gmail.com>
parents: 37416
diff changeset
54 #define FB_UTIL_ERROR fb_util_error_quark()
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
55
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
56 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
57 * FbUtilRequestBuddyFunc:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
58 * @buddies: The list of #PurpleBuddy's.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
59 * @data: The user-defined data.
37358
fbb9041f0c01 facebook: added missing GTK-Doc description
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
60 *
fbb9041f0c01 facebook: added missing GTK-Doc description
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
61 * The callback for requested buddies.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
62 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
63 typedef void (*FbUtilRequestBuddyFunc) (GSList *buddies, gpointer data);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
64
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
65 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
66 * FbUtilDebugFlags:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
67 * @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
68 * @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
69 * @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
70 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
71 * 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
72 * a #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
73 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
74 typedef enum
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
75 {
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37358
diff changeset
76 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
77 FB_UTIL_DEBUG_FLAG_VERBOSE = 1 << 26,
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37358
diff changeset
78 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
79 } FbUtilDebugFlags;
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
80
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
81 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
82 * FbUtilError:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
83 * @FB_UTIL_ERROR_GENERAL: General failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
84 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
85 * 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
86 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
87 typedef enum
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
88 {
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
89 FB_UTIL_ERROR_GENERAL
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
90 } FbUtilError;
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
91
37347
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 * fb_util_error_quark:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
94 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
95 * 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
96 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
97 * Returns: The #GQuark of the domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
98 */
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
99 GQuark
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
100 fb_util_error_quark(void);
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
101
37347
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 * fb_util_account_find_buddy:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
104 * @acct: The #PurpleAccount.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
105 * @chat: The #PurpleChatConversation.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
106 * @name: The name of the buddy.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37414
diff changeset
107 * @error: The return location for the #GError or #NULL.
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 * 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
110 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
111 * 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
112 */
37284
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
113 PurpleBuddy *
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
114 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
115 const gchar *name, GError **error);
53cb588d8760 facebook: implemented kicking/leaving group chats
James Geboski <jgeboski@gmail.com>
parents: 37278
diff changeset
116
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
117 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
118 * fb_util_debug:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
119 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
120 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
121 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
122 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
123 * 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
124 * apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
125 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
126 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
127 fb_util_debug(PurpleDebugLevel level, const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
128 G_GNUC_PRINTF(2, 3);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
129
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
130 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
131 * fb_util_vdebug:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
132 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
133 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
134 * @ap: The #va_list.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
135 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
136 * 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
137 * apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
138 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
139 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
140 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
141
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
142 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
143 * fb_util_debug_misc:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
144 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
145 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
146 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
147 * 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
148 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
149 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
150 fb_util_debug_misc(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
151 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
152
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
153 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
154 * fb_util_debug_info:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
155 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
156 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
157 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
158 * 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
159 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
160 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
161 fb_util_debug_info(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
162 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
163
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
164 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
165 * fb_util_debug_warning:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
166 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
167 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
168 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
169 * 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
170 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
171 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
172 fb_util_debug_warning(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
173 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
174
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
175 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
176 * fb_util_debug_error:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
177 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
178 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
179 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
180 * 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
181 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
182 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
183 fb_util_debug_error(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
184 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
185
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
186 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
187 * fb_util_debug_fatal:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
188 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
189 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
190 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
191 * 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
192 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
193 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
194 fb_util_debug_fatal(const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
195 G_GNUC_PRINTF(1, 2);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
196
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
197 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
198 * fb_util_debug_hexdump:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
199 * @level: The #PurpleDebugLevel.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
200 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
201 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
202 * @...: The arguments for @format.
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 * 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
205 * verbose, apply the appropriate #FbUtilDebugFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
206 */
37278
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
207 void
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
208 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
209 const gchar *format, ...)
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
210 G_GNUC_PRINTF(3, 4);
3ee1b27dacc4 facebook: added debugging utilities and messages
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
211
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
212 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
213 * fb_util_get_locale:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
214 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
215 * 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
216 * 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
217 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
218 * Returns: The locale string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
219 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
220 gchar *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
221 fb_util_get_locale(void);
37260
473934b0c408 facebook: use working locale language
James Geboski <jgeboski@gmail.com>
parents: 37258
diff changeset
222
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
223 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
224 * fb_util_rand_alnum:
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
225 * @len: The length of the string.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
226 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
227 * Gets a random alphanumeric (A-Za-z0-9) string. This function should
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
228 * *not* be relied on for cryptographic operations. The returned string
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
229 * should be freed with #g_free() when no longer needed.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
230 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
231 * Returns: The alphanumeric string.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
232 */
37260
473934b0c408 facebook: use working locale language
James Geboski <jgeboski@gmail.com>
parents: 37258
diff changeset
233 gchar *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
234 fb_util_rand_alnum(guint len);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
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: 37317
diff changeset
236 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
237 * fb_util_request_buddy:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
238 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
239 * @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
240 * @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
241 * @secondary: The secondary information or #NULL.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37414
diff changeset
242 * @select: A #GSList of selected buddies or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
243 * @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
244 * @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
245 * @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
246 * @data: The user-defined data.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
247 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
248 * Displays a buddy list selection form.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
249 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
250 * Returns: The UI-specific handle.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
251 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
252 gpointer
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
253 fb_util_request_buddy(PurpleConnection *gc, const gchar *title,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
254 const gchar *primary, const gchar *secondary,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
255 GSList *select, gboolean multi, GCallback ok_cb,
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
256 GCallback cancel_cb, gpointer data);
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
257
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
258 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
259 * fb_util_serv_got_im:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
260 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
261 * @who: The message sender or receiver.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
262 * @text: The message text.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
263 * @flags: The #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
264 * @timestamp: The message timestamp.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
265 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
266 * 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
267 * 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
268 * message from the #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
269 */
37317
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
270 void
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
271 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
272 PurpleMessageFlags flags, guint64 timestamp);
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
273
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
274 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
275 * fb_util_serv_got_chat_in:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
276 * @gc: The #PurpleConnection.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
277 * @id: The id of the chat.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
278 * @who: The message sender or receiver.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
279 * @text: The message text.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
280 * @flags: The #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
281 * @timestamp: The message timestamp.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
282 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
283 * 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
284 * 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
285 * the message from the #PurpleMessageFlags.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
286 */
37317
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
287 void
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
288 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
289 const gchar *text, PurpleMessageFlags flags,
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
290 guint64 timestamp);
143a4d8db15c facebook: implemented self messages
James Geboski <jgeboski@gmail.com>
parents: 37310
diff changeset
291
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
292 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
293 * fb_util_strtest:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
294 * @str: The string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
295 * @type: The #GAsciiType.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
296 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
297 * Tests if the string only contains characters allowed by the
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
298 * #GAsciiType. More than one type can be specified by ORing the types
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
299 * together.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
300 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
301 * Returns: #TRUE if the string only contains characters allowed by the
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
302 * #GAsciiType, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
303 */
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
304 gboolean
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
305 fb_util_strtest(const gchar *str, GAsciiType type);
37258
291b6e1acc24 facebook: implemented group chat support
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
306
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
307 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
308 * fb_util_zlib_test:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
309 * @bytes: The #GByteArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
310 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
311 * Tests if the #GByteArray is zlib compressed.
37347
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 * 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
314 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
315 gboolean
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
316 fb_util_zlib_test(const GByteArray *bytes);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
317
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
318 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
319 * fb_util_zlib_deflate:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
320 * @bytes: The #GByteArray.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37414
diff changeset
321 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
322 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
323 * Deflates a #GByteArray with zlib. The returned #GByteArray should be
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
324 * freed with #g_byte_array_free() when no longer needed.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
325 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
326 * Returns: The deflated #GByteArray or #NULL on error.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
327 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
328 GByteArray *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
329 fb_util_zlib_deflate(const GByteArray *bytes, GError **error);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
330
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
331 /**
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
332 * fb_util_zlib_inflate:
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
333 * @bytes: The #GByteArray.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37414
diff changeset
334 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
335 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
336 * Inflates a #GByteArray with zlib. The returned #GByteArray should be
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
337 * freed with #g_byte_array_free() when no longer needed.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37317
diff changeset
338 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
339 * Returns: The inflated #GByteArray or #NULL on error.
37347
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 *
37416
77536a48b4be facebook: refactored util naming and GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
342 fb_util_zlib_inflate(const GByteArray *bytes, GError **error);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
343
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37471
diff changeset
344 #endif /* PURPLE_FACEBOOK_UTIL_H */

mercurial