annotate libpurple/notify.c @ 32386:978a070e8724

Fix an inconsequential memory leak. We weren't freeing this dudes at shutdown. Now we R.
author Mark Doliner <mark@kingant.net>
date Mon, 12 Dec 2011 07:30:21 +0000
parents 8878ea011fa1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file notify.c Notification API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 * @ingroup core
20074
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
4 */
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
5
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
6 /* purple
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18675
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 */
24350
8282911d5e17 Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents: 23205
diff changeset
26 #define _PURPLE_NOTIFY_C_
8282911d5e17 Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents: 23205
diff changeset
27
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
28 #include "internal.h"
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
29 #include "dbus-maybe.h"
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
32 static PurpleNotifyUiOps *notify_ui_ops = NULL;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 static GList *handles = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
37 PurpleNotifyType type;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 void *handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 void *ui_handle;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
40 PurpleNotifyCloseCallback cb;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 gpointer cb_user_data;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
42 } PurpleNotifyInfo;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 * Definition of a user info entry
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
47 struct _PurpleNotifyUserInfoEntry
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 char *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 char *value;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
51 PurpleNotifyUserInfoEntryType type;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
54 struct _PurpleNotifyUserInfo
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 {
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
56 GQueue entries;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58
32319
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
59 /**
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
60 * Single column of a search result.
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
61 */
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
62 struct _PurpleNotifySearchColumn
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
63 {
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
64 char *title; /**< Title of the column. */
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
65 gboolean visible; /**< Should the column be visible to the user. Defaults to TRUE. */
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
66
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
67 };
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
68
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
70 purple_notify_message(void *handle, PurpleNotifyMsgType type,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 const char *title, const char *primary,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
72 const char *secondary, PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
74 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 g_return_val_if_fail(primary != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
78 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 if (ops != NULL && ops->notify_message != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
81 void *ui_handle = ops->notify_message(type, title, primary,
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
82 secondary);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
83 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
85 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
86 info->type = PURPLE_NOTIFY_MESSAGE;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
87 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
88 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
89 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
90 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
99 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
100 cb(user_data);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
101
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
106 purple_notify_email(void *handle, const char *subject, const char *from,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
107 const char *to, const char *url, PurpleNotifyCloseCallback cb,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
110 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
112 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 if (ops != NULL && ops->notify_email != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
115 void *ui_handle;
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
116
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
117 purple_signal_emit(purple_notify_get_handle(), "displaying-email-notification",
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
118 subject, from, to, url);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
119
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
120 ui_handle = ops->notify_email(handle, subject, from, to, url);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
121
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
122 if (ui_handle != NULL) {
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
123
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
124 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
125 info->type = PURPLE_NOTIFY_EMAIL;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
126 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
127 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
128 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
129 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
134 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
135 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
137 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
138 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
144 purple_notify_emails(void *handle, size_t count, gboolean detailed,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 const char **subjects, const char **froms,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 const char **tos, const char **urls,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
147 PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
149 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 if (count == 1) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
152 return purple_notify_email(handle,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 (subjects == NULL ? NULL : *subjects),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 (froms == NULL ? NULL : *froms),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 (tos == NULL ? NULL : *tos),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 (urls == NULL ? NULL : *urls),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 cb, user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
160 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 if (ops != NULL && ops->notify_emails != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
163 void *ui_handle;
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
164
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
165 purple_signal_emit(purple_notify_get_handle(), "displaying-emails-notification",
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
166 subjects, froms, tos, urls, count);
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
167
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
168 ui_handle = ops->notify_emails(handle, count, detailed, subjects,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 froms, tos, urls);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
171 if (ui_handle != NULL) {
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
172 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
173 info->type = PURPLE_NOTIFY_EMAILS;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
174 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
175 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
176 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
177 info->cb_user_data = user_data;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
178
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
186 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
187 cb(user_data);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
188
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
193 purple_notify_formatted(void *handle, const char *title, const char *primary,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 const char *secondary, const char *text,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
195 PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
197 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 g_return_val_if_fail(primary != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
201 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 if (ops != NULL && ops->notify_formatted != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
204 void *ui_handle = ops->notify_formatted(title, primary, secondary, text);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
205
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
206 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
208 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
209 info->type = PURPLE_NOTIFY_FORMATTED;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
210 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
211 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
212 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
213 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
221 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
222 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
227 purple_notify_searchresults(PurpleConnection *gc, const char *title,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 const char *primary, const char *secondary,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
229 PurpleNotifySearchResults *results, PurpleNotifyCloseCallback cb,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
232 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
234 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 if (ops != NULL && ops->notify_searchresults != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
237 void *ui_handle = ops->notify_searchresults(gc, title, primary,
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
238 secondary, results, user_data);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
239 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
241 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
242 info->type = PURPLE_NOTIFY_SEARCHRESULTS;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
243 info->handle = gc;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
244 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
245 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
246 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
251 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
252 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
254 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
255 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
261 purple_notify_searchresults_free(PurpleNotifySearchResults *results)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 for (l = results->buttons; l; l = g_list_delete_link(l, l)) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
268 PurpleNotifySearchButton *button = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 g_free(button->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 g_free(button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 for (l = results->rows; l; l = g_list_delete_link(l, l)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 GList *row = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 g_list_foreach(row, (GFunc)g_free, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 g_list_free(row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 for (l = results->columns; l; l = g_list_delete_link(l, l)) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
280 PurpleNotifySearchColumn *column = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 g_free(column->title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 g_free(column);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 g_free(results);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
289 purple_notify_searchresults_new_rows(PurpleConnection *gc,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
290 PurpleNotifySearchResults *results,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 void *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
293 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
295 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 if (ops != NULL && ops->notify_searchresults != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 ops->notify_searchresults_new_rows(gc, results, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
303 purple_notify_searchresults_button_add(PurpleNotifySearchResults *results,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
304 PurpleNotifySearchButtonType type,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
305 PurpleNotifySearchResultsCallback cb)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
307 PurpleNotifySearchButton *button;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 g_return_if_fail(cb != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
312 button = g_new0(PurpleNotifySearchButton, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 button->callback = cb;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 button->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 results->buttons = g_list_append(results->buttons, button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
321 purple_notify_searchresults_button_add_labeled(PurpleNotifySearchResults *results,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 const char *label,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
323 PurpleNotifySearchResultsCallback cb) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
324 PurpleNotifySearchButton *button;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327 g_return_if_fail(cb != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 g_return_if_fail(label != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 g_return_if_fail(*label != '\0');
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
331 button = g_new0(PurpleNotifySearchButton, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 button->callback = cb;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
333 button->type = PURPLE_NOTIFY_BUTTON_LABELED;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 button->label = g_strdup(label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 results->buttons = g_list_append(results->buttons, button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
337 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
339
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
340 PurpleNotifySearchResults *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
341 purple_notify_searchresults_new()
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
343 PurpleNotifySearchResults *rs = g_new0(PurpleNotifySearchResults, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 return rs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
348 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
349 purple_notify_searchresults_column_add(PurpleNotifySearchResults *results,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
350 PurpleNotifySearchColumn *column)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
352 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353 g_return_if_fail(column != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355 results->columns = g_list_append(results->columns, column);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
358 void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359 GList *row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
362 g_return_if_fail(row != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
363
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364 results->rows = g_list_append(results->rows, row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
367 PurpleNotifySearchColumn *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
368 purple_notify_searchresults_column_new(const char *title)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
370 PurpleNotifySearchColumn *sc;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 g_return_val_if_fail(title != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
374 sc = g_new0(PurpleNotifySearchColumn, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 sc->title = g_strdup(title);
31845
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
376 sc->visible = TRUE;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 return sc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380
32319
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
381 const char *purple_notify_searchresult_column_get_title(const PurpleNotifySearchColumn *column)
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
382 {
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
383 g_return_val_if_fail(column != NULL, NULL);
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
384
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
385 return column->title;
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
386 }
8878ea011fa1 Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents: 31920
diff changeset
387
31845
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
388 void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible)
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
389 {
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
390 g_return_if_fail(column != NULL);
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
391
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
392 column->visible = visible;
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
393 }
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
394
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
395 gboolean
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
396 purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column)
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
397 {
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
398 g_return_val_if_fail(column != NULL, FALSE);
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
399
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
400 return column->visible;
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
401 }
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
402
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
404 purple_notify_userinfo(PurpleConnection *gc, const char *who,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
405 PurpleNotifyUserInfo *user_info, PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
407 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 g_return_val_if_fail(who != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
411 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413 if (ops != NULL && ops->notify_userinfo != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
414 void *ui_handle;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
416 purple_signal_emit(purple_notify_get_handle(), "displaying-userinfo",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
417 purple_connection_get_account(gc), who, user_info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
419 ui_handle = ops->notify_userinfo(gc, who, user_info);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
420
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
421 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
423 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
424 info->type = PURPLE_NOTIFY_USERINFO;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
425 info->handle = gc;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
426 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
427 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
428 info->cb_user_data = user_data;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
429
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
433 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
434 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
436 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
437 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
442 PurpleNotifyUserInfoEntry *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
443 purple_notify_user_info_entry_new(const char *label, const char *value)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
445 PurpleNotifyUserInfoEntry *user_info_entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
446
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
447 user_info_entry = g_new0(PurpleNotifyUserInfoEntry, 1);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
448 PURPLE_DBUS_REGISTER_POINTER(user_info_entry, PurpleNotifyUserInfoEntry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 user_info_entry->label = g_strdup(label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 user_info_entry->value = g_strdup(value);
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
451 user_info_entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 return user_info_entry;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 static void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
457 purple_notify_user_info_entry_destroy(PurpleNotifyUserInfoEntry *user_info_entry)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 g_return_if_fail(user_info_entry != NULL);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
460
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 g_free(user_info_entry->label);
20586
04590d9db8b7 Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20074
diff changeset
462 g_free(user_info_entry->value);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
463 PURPLE_DBUS_UNREGISTER_POINTER(user_info_entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 g_free(user_info_entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
467 PurpleNotifyUserInfo *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
468 purple_notify_user_info_new()
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
470 PurpleNotifyUserInfo *user_info;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
471
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
472 user_info = g_new0(PurpleNotifyUserInfo, 1);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
473 PURPLE_DBUS_REGISTER_POINTER(user_info, PurpleNotifyUserInfo);
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
474 g_queue_init(&user_info->entries);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
475
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 return user_info;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
480 purple_notify_user_info_destroy(PurpleNotifyUserInfo *user_info)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
484 for (l = user_info->entries.head; l != NULL; l = l->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
485 PurpleNotifyUserInfoEntry *user_info_entry = l->data;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
486
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
487 purple_notify_user_info_entry_destroy(user_info_entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
488 }
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
489
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
490 g_queue_clear(&user_info->entries);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
491 PURPLE_DBUS_UNREGISTER_POINTER(user_info);
16597
2ddffaf3613a Plug a memory leak.
Ka-Hing Cheung <khc@hxbc.us>
parents: 15822
diff changeset
492 g_free(user_info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494
31909
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
495 GQueue *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
496 purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 g_return_val_if_fail(user_info != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
500 return &user_info->entries;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 char *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
504 purple_notify_user_info_get_text_with_newline(PurpleNotifyUserInfo *user_info, const char *newline)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507 GString *text;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
508
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 text = g_string_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
511 for (l = user_info->entries.head; l != NULL; l = l->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
512 PurpleNotifyUserInfoEntry *user_info_entry = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 /* Add a newline before a section header */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
514 if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 g_string_append(text, newline);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 /* Handle the label/value pair itself */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 /* XXX Todo: Use a larger size for a section header? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 if (user_info_entry->label)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 g_string_append_printf(text, "<b>%s</b>", user_info_entry->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 if (user_info_entry->label && user_info_entry->value)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 g_string_append(text, ": ");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 if (user_info_entry->value)
20586
04590d9db8b7 Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20074
diff changeset
524 g_string_append(text, user_info_entry->value);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 /* Display a section break as a horizontal line */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
527 if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 g_string_append(text, "<HR>");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 /* Don't insert a new line before or after a section break; <HR> does that for us */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
531 if ((user_info_entry->type != PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
532 (l->next && ((((PurpleNotifyUserInfoEntry *)(l->next->data))->type != PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK))))
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533 g_string_append(text, newline);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
534
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 /* Add an extra newline after a section header */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
536 if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537 g_string_append(text, newline);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 return g_string_free(text, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543
22622
93c40e412b54 constify the return value from purple_notify_user_info_entry_get_label
Mark Doliner <mark@kingant.net>
parents: 21000
diff changeset
544 const gchar *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
545 purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 g_return_val_if_fail(user_info_entry != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 return user_info_entry->label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
553 purple_notify_user_info_entry_set_label(PurpleNotifyUserInfoEntry *user_info_entry, const char *label)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 g_return_if_fail(user_info_entry != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557 g_free(user_info_entry->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 user_info_entry->label = g_strdup(label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560
22622
93c40e412b54 constify the return value from purple_notify_user_info_entry_get_label
Mark Doliner <mark@kingant.net>
parents: 21000
diff changeset
561 const gchar *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
562 purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564 g_return_val_if_fail(user_info_entry != NULL, NULL);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
565
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 return user_info_entry->value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
570 purple_notify_user_info_entry_set_value(PurpleNotifyUserInfoEntry *user_info_entry, const char *value)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
571 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572 g_return_if_fail(user_info_entry != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
574 g_free(user_info_entry->value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 user_info_entry->value = g_strdup(value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
576 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
577
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
578 PurpleNotifyUserInfoEntryType
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
579 purple_notify_user_info_entry_get_type(PurpleNotifyUserInfoEntry *user_info_entry)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
581 g_return_val_if_fail(user_info_entry != NULL, PURPLE_NOTIFY_USER_INFO_ENTRY_PAIR);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
583 return user_info_entry->type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
587 purple_notify_user_info_entry_set_type(PurpleNotifyUserInfoEntry *user_info_entry, PurpleNotifyUserInfoEntryType type)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
588 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
589 g_return_if_fail(user_info_entry != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591 user_info_entry->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
594 void
31907
99ca503ea087 Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents: 31858
diff changeset
595 purple_notify_user_info_add_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
596 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
597 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
598
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
599 entry = purple_notify_user_info_entry_new(label, value);
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
600 g_queue_push_tail(&user_info->entries, entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
601 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
602
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
603 void
31361
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
604 purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
605 {
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
606 gchar *escaped;
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
607
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
608 escaped = g_markup_escape_text(value, -1);
31907
99ca503ea087 Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents: 31858
diff changeset
609 purple_notify_user_info_add_pair_html(user_info, label, escaped);
31361
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
610 g_free(escaped);
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
611 }
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
612
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
613 void
31920
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
614 purple_notify_user_info_prepend_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
616 PurpleNotifyUserInfoEntry *entry;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
617
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
618 entry = purple_notify_user_info_entry_new(label, value);
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
619 g_queue_push_head(&user_info->entries, entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 void
31920
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
623 purple_notify_user_info_prepend_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
624 {
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
625 gchar *escaped;
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
626
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
627 escaped = g_markup_escape_text(value, -1);
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
628 purple_notify_user_info_prepend_pair_html(user_info, label, escaped);
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
629 g_free(escaped);
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
630 }
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
631
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
632 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
633 purple_notify_user_info_remove_entry(PurpleNotifyUserInfo *user_info, PurpleNotifyUserInfoEntry *entry)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635 g_return_if_fail(user_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
636 g_return_if_fail(entry != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
638 g_queue_remove(&user_info->entries, entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
642 purple_notify_user_info_add_section_header(PurpleNotifyUserInfo *user_info, const char *label)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
643 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
644 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
645
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
646 entry = purple_notify_user_info_entry_new(label, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
647 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
649 g_queue_push_tail(&user_info->entries, entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
650 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
651
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
652 void
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
653 purple_notify_user_info_prepend_section_header(PurpleNotifyUserInfo *user_info, const char *label)
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
654 {
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
655 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
656
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
657 entry = purple_notify_user_info_entry_new(label, NULL);
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
658 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
659
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
660 g_queue_push_head(&user_info->entries, entry);
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
661 }
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
662
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
663 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
664 purple_notify_user_info_add_section_break(PurpleNotifyUserInfo *user_info)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
665 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
666 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
667
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
668 entry = purple_notify_user_info_entry_new(NULL, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
669 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
670
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
671 g_queue_push_tail(&user_info->entries, entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674 void
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
675 purple_notify_user_info_prepend_section_break(PurpleNotifyUserInfo *user_info)
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
676 {
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
677 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
678
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
679 entry = purple_notify_user_info_entry_new(NULL, NULL);
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
680 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
681
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
682 g_queue_push_head(&user_info->entries, entry);
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
683 }
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
684
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
685 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
686 purple_notify_user_info_remove_last_item(PurpleNotifyUserInfo *user_info)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 {
31909
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
688 PurpleNotifyUserInfoEntry *entry;
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
689
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
690 entry = g_queue_pop_tail(&user_info->entries);
31909
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
691 if (entry)
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
692 purple_notify_user_info_entry_destroy(entry);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
695 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
696 purple_notify_uri(void *handle, const char *uri)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
698 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
699
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
700 g_return_val_if_fail(uri != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
702 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 if (ops != NULL && ops->notify_uri != NULL) {
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
705
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
706 void *ui_handle = ops->notify_uri(uri);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
707
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
708 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
710 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
711 info->type = PURPLE_NOTIFY_URI;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
712 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
713 info->ui_handle = ui_handle;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
720
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
722 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
724 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
725 purple_notify_close(PurpleNotifyType type, void *ui_handle)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 GList *l;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
728 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
729
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 g_return_if_fail(ui_handle != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
731
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
732 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
733
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
734 for (l = handles; l != NULL; l = l->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
735 PurpleNotifyInfo *info = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737 if (info->ui_handle == ui_handle) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738 handles = g_list_remove(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740 if (ops != NULL && ops->close_notify != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741 ops->close_notify(info->type, ui_handle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743 if (info->cb != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
744 info->cb(info->cb_user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
746 g_free(info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
747
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
748 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
754 purple_notify_close_with_handle(void *handle)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755 {
17620
c1c533448097 sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17066
diff changeset
756 GList *l, *prev = NULL;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
757 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759 g_return_if_fail(handle != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
760
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
761 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
762
17620
c1c533448097 sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17066
diff changeset
763 for (l = handles; l != NULL; l = prev ? prev->next : handles) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
764 PurpleNotifyInfo *info = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766 if (info->handle == handle) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 handles = g_list_remove(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769 if (ops != NULL && ops->close_notify != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 ops->close_notify(info->type, info->ui_handle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 if (info->cb != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 info->cb(info->cb_user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 g_free(info);
17620
c1c533448097 sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17066
diff changeset
776 } else
c1c533448097 sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17066
diff changeset
777 prev = l;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
778 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
780
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
782 purple_notify_set_ui_ops(PurpleNotifyUiOps *ops)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784 notify_ui_ops = ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
786
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
787 PurpleNotifyUiOps *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
788 purple_notify_get_ui_ops(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
789 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
790 return notify_ui_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
791 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
792
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
793 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
794 purple_notify_get_handle(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
796 static int handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
797
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
798 return &handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
799 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
801 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
802 purple_notify_init(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
803 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
804 gpointer handle = purple_notify_get_handle();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
806 purple_signal_register(handle, "displaying-email-notification",
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
807 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER, NULL, 4,
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
808 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
809 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
810 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
811 purple_value_new(PURPLE_TYPE_STRING));
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
812
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
813 purple_signal_register(handle, "displaying-emails-notification",
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
814 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, NULL, 5,
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
815 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
816 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
817 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
818 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
819 purple_value_new(PURPLE_TYPE_UINT));
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
820
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
821 purple_signal_register(handle, "displaying-userinfo",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
822 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
823 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
824 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
825 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
826 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
827 PURPLE_SUBTYPE_USERINFO));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
828 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
829
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
830 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
831 purple_notify_uninit(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
832 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
833 purple_signals_unregister_by_instance(purple_notify_get_handle());
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
834 }