annotate libpurple/notify.c @ 31975:e5e81ce9c564

These pointers should rather be marked const.
author andrew.victor@mxit.com
date Fri, 26 Aug 2011 21:25:25 +0000
parents 0cc718e10344
children 8878ea011fa1
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
60 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
61 const char *title, const char *primary,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
62 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
63 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
64 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 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
67
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
68 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 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
71 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
72 secondary);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
73 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
75 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
76 info->type = PURPLE_NOTIFY_MESSAGE;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
77 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
78 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
79 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
80 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
89 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
90 cb(user_data);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
91
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 return NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
96 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
97 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
98 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
100 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
102 ops = purple_notify_get_ui_ops();
15373
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 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
105 void *ui_handle;
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
106
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
107 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
108 subject, from, to, url);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
109
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
110 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
111
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
112 if (ui_handle != NULL) {
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
113
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
114 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
115 info->type = PURPLE_NOTIFY_EMAIL;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
116 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
117 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
118 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
119 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
124 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
125 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
127 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
128 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 }
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 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
134 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
135 const char **subjects, const char **froms,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 const char **tos, const char **urls,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
137 PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
139 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 if (count == 1) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
142 return purple_notify_email(handle,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 (subjects == NULL ? NULL : *subjects),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 (froms == NULL ? NULL : *froms),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 (tos == NULL ? NULL : *tos),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 (urls == NULL ? NULL : *urls),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 cb, user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
150 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 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
153 void *ui_handle;
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
154
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
155 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
156 subjects, froms, tos, urls, count);
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
157
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
158 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
159 froms, tos, urls);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
161 if (ui_handle != NULL) {
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
162 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
163 info->type = PURPLE_NOTIFY_EMAILS;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
164 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
165 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
166 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
167 info->cb_user_data = user_data;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
168
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
176 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
177 cb(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 return NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
183 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
184 const char *secondary, const char *text,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
185 PurpleNotifyCloseCallback cb, gpointer user_data)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
187 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 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
190
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
191 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 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
194 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
195
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
196 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
198 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
199 info->type = PURPLE_NOTIFY_FORMATTED;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
200 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
201 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
202 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
203 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
211 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
212 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 return NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
217 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
218 const char *primary, const char *secondary,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
219 PurpleNotifySearchResults *results, PurpleNotifyCloseCallback cb,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
222 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
224 ops = purple_notify_get_ui_ops();
15373
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 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
227 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
228 secondary, results, user_data);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
229 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
231 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
232 info->type = PURPLE_NOTIFY_SEARCHRESULTS;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
233 info->handle = gc;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
234 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
235 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
236 info->cb_user_data = user_data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
241 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
242 }
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
244 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
245 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 }
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 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
251 purple_notify_searchresults_free(PurpleNotifySearchResults *results)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 g_return_if_fail(results != NULL);
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 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
258 PurpleNotifySearchButton *button = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 g_free(button->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 g_free(button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 }
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 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
264 GList *row = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 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
266 g_list_free(row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 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
270 PurpleNotifySearchColumn *column = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 g_free(column->title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 g_free(column);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 g_free(results);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 }
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 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
279 purple_notify_searchresults_new_rows(PurpleConnection *gc,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
280 PurpleNotifySearchResults *results,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 void *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
283 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
285 ops = purple_notify_get_ui_ops();
15373
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 if (ops != NULL && ops->notify_searchresults != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 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
289 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
293 purple_notify_searchresults_button_add(PurpleNotifySearchResults *results,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
294 PurpleNotifySearchButtonType type,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
295 PurpleNotifySearchResultsCallback cb)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
297 PurpleNotifySearchButton *button;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 g_return_if_fail(cb != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
302 button = g_new0(PurpleNotifySearchButton, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 button->callback = cb;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 button->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 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
307 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
311 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
312 const char *label,
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
313 PurpleNotifySearchResultsCallback cb) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
314 PurpleNotifySearchButton *button;
15373
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 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 g_return_if_fail(cb != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 g_return_if_fail(label != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 g_return_if_fail(*label != '\0');
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
321 button = g_new0(PurpleNotifySearchButton, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 button->callback = cb;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
323 button->type = PURPLE_NOTIFY_BUTTON_LABELED;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324 button->label = g_strdup(label);
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 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
327 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
330 PurpleNotifySearchResults *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
331 purple_notify_searchresults_new()
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
333 PurpleNotifySearchResults *rs = g_new0(PurpleNotifySearchResults, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335 return rs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 }
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 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
339 purple_notify_searchresults_column_add(PurpleNotifySearchResults *results,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
340 PurpleNotifySearchColumn *column)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 g_return_if_fail(column != NULL);
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 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
346 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
348 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
349 GList *row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 g_return_if_fail(results != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
352 g_return_if_fail(row != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354 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
355 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
357 PurpleNotifySearchColumn *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
358 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
359 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
360 PurpleNotifySearchColumn *sc;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
362 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
363
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
364 sc = g_new0(PurpleNotifySearchColumn, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 sc->title = g_strdup(title);
31845
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
366 sc->visible = TRUE;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368 return sc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370
31845
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
371 void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible)
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
372 {
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
373 g_return_if_fail(column != NULL);
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
374
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
375 column->visible = visible;
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
376 }
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
377
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
378 gboolean
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
379 purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column)
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
380 {
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
381 g_return_val_if_fail(column != NULL, FALSE);
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
382
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
383 return column->visible;
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
384 }
63fb41aa3dbe Add API:
andrew.victor@mxit.com
parents: 31361
diff changeset
385
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
387 purple_notify_userinfo(PurpleConnection *gc, const char *who,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
388 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
389 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
390 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392 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
393
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
394 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
396 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
397 void *ui_handle;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
399 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
400 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
401
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
402 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
403
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
404 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
406 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
407 info->type = PURPLE_NOTIFY_USERINFO;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
408 info->handle = gc;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
409 info->ui_handle = ui_handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
410 info->cb = cb;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
411 info->cb_user_data = user_data;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
412
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413 handles = g_list_append(handles, info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415 return info->ui_handle;
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
416 }
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
417 }
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 if (cb != NULL)
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
420 cb(user_data);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
425 PurpleNotifyUserInfoEntry *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
426 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
427 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
428 PurpleNotifyUserInfoEntry *user_info_entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
429
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
430 user_info_entry = g_new0(PurpleNotifyUserInfoEntry, 1);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
431 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
432 user_info_entry->label = g_strdup(label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 user_info_entry->value = g_strdup(value);
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
434 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
435
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436 return user_info_entry;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 }
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 static void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
440 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
441 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 g_return_if_fail(user_info_entry != NULL);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
443
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 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
445 g_free(user_info_entry->value);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
446 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
447 g_free(user_info_entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
450 PurpleNotifyUserInfo *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
451 purple_notify_user_info_new()
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
453 PurpleNotifyUserInfo *user_info;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
454
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
455 user_info = g_new0(PurpleNotifyUserInfo, 1);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
456 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
457 g_queue_init(&user_info->entries);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
458
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 return user_info;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
463 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
464 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
467 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
468 PurpleNotifyUserInfoEntry *user_info_entry = l->data;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
469
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
470 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
471 }
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
472
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
473 g_queue_clear(&user_info->entries);
17066
46351036fdb4 DBusify userinfo stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16597
diff changeset
474 PURPLE_DBUS_UNREGISTER_POINTER(user_info);
16597
2ddffaf3613a Plug a memory leak.
Ka-Hing Cheung <khc@hxbc.us>
parents: 15822
diff changeset
475 g_free(user_info);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477
31909
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
478 GQueue *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
479 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
480 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 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
482
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
483 return &user_info->entries;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 char *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
487 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
488 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 GString *text;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
491
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 text = g_string_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
494 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
495 PurpleNotifyUserInfoEntry *user_info_entry = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 /* Add a newline before a section header */
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
497 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
498 g_string_append(text, newline);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 /* Handle the label/value pair itself */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 /* 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
502 if (user_info_entry->label)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 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
504 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
505 g_string_append(text, ": ");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 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
507 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
508
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 /* 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
510 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
511 g_string_append(text, "<HR>");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 /* 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
514 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
515 (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
516 g_string_append(text, newline);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
517
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 /* 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
519 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
520 g_string_append(text, newline);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 return g_string_free(text, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 }
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
22622
93c40e412b54 constify the return value from purple_notify_user_info_entry_get_label
Mark Doliner <mark@kingant.net>
parents: 21000
diff changeset
527 const gchar *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
528 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
529 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 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
531
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 return user_info_entry->label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
536 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
537 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 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
539
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 g_free(user_info_entry->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541 user_info_entry->label = g_strdup(label);
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_value(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);
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
548
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 return user_info_entry->value;
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_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
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->value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 user_info_entry->value = g_strdup(value);
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
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
561 PurpleNotifyUserInfoEntryType
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
562 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
563 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
564 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
565
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 return user_info_entry->type;
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_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
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 user_info_entry->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 }
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 void
31907
99ca503ea087 Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents: 31858
diff changeset
578 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
579 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
580 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
581
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
582 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
583 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
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
31361
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
587 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
588 {
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
589 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
590
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
591 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
592 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
593 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
594 }
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
595
0123c69ec0e5 Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents: 25924
diff changeset
596 void
31920
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
597 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
598 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
599 PurpleNotifyUserInfoEntry *entry;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
600
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
601 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
602 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
603 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
604
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
605 void
31920
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
606 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
607 {
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
608 gchar *escaped;
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
609
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
610 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
611 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
612 g_free(escaped);
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
613 }
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
614
0cc718e10344 Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents: 31910
diff changeset
615 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
616 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
617 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 g_return_if_fail(user_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 g_return_if_fail(entry != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
621 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
622 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
625 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
626 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
627 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
628
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
629 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
630 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
631
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
632 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
633 }
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 void
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
636 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
637 {
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
638 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
639
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
640 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
641 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
642
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
643 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
644 }
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
645
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
646 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
647 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
648 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
649 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
650
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
651 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
652 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
653
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
654 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
655 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
657 void
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
658 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
659 {
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
660 PurpleNotifyUserInfoEntry *entry;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
661
23205
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
662 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
663 entry->type = PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK;
25924
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 24350
diff changeset
664
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
665 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
666 }
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
667
84693a70ea3a Added prepend functions for notify_user_info section headers and breaks
Evan Schoenberg <evan.s@dreskin.net>
parents: 22820
diff changeset
668 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
669 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
670 {
31909
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
671 PurpleNotifyUserInfoEntry *entry;
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
672
31910
0ee025d8686e user_info->user_info_entries is redundant. Let's call it
Mark Doliner <mark@kingant.net>
parents: 31909
diff changeset
673 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
674 if (entry)
6283c0f2b02f Change PurpleNotifyUserInfo->user_info_entries from a GList to a GQueue.
Mark Doliner <mark@kingant.net>
parents: 31907
diff changeset
675 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
676 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
677
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
678 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
679 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
680 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
681 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
682
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683 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
684
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
685 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 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
688
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
689 void *ui_handle = ops->notify_uri(uri);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
690
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
691 if (ui_handle != NULL) {
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692
22820
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
693 PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
694 info->type = PURPLE_NOTIFY_URI;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
695 info->handle = handle;
5e6b42e77fb7 Cleanup and avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 22622
diff changeset
696 info->ui_handle = ui_handle;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698 handles = g_list_append(handles, info);
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 return info->ui_handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 }
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 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
708 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
709 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710 GList *l;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
711 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
712
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713 g_return_if_fail(ui_handle != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
715 ops = purple_notify_get_ui_ops();
15373
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 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
718 PurpleNotifyInfo *info = l->data;
15373
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 if (info->ui_handle == ui_handle) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 handles = g_list_remove(handles, info);
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 if (ops != NULL && ops->close_notify != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
724 ops->close_notify(info->type, ui_handle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726 if (info->cb != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 info->cb(info->cb_user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
729 g_free(info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
731 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732 }
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
737 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
738 {
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
739 GList *l, *prev = NULL;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
740 PurpleNotifyUiOps *ops;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742 g_return_if_fail(handle != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
744 ops = purple_notify_get_ui_ops();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745
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
746 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
747 PurpleNotifyInfo *info = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
748
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749 if (info->handle == handle) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 handles = g_list_remove(handles, info);
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 if (ops != NULL && ops->close_notify != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 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
754
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755 if (info->cb != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
756 info->cb(info->cb_user_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758 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
759 } 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
760 prev = l;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
762 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
763
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
765 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
766 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 notify_ui_ops = ops;
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
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
770 PurpleNotifyUiOps *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
771 purple_notify_get_ui_ops(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 return notify_ui_ops;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
776 void *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
777 purple_notify_get_handle(void)
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 static int handle;
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 return &handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782 }
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 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
785 purple_notify_init(void)
15373
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 gpointer handle = purple_notify_get_handle();
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788
18675
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
789 purple_signal_register(handle, "displaying-email-notification",
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
790 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
791 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
792 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
793 purple_value_new(PURPLE_TYPE_STRING),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
794 purple_value_new(PURPLE_TYPE_STRING));
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
795
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
796 purple_signal_register(handle, "displaying-emails-notification",
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
797 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
798 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
799 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
800 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
801 purple_value_new(PURPLE_TYPE_POINTER),
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
802 purple_value_new(PURPLE_TYPE_UINT));
cb91bb07eeff Email notification signals from charkins. Fixes #1324
Sean Egan <seanegan@gmail.com>
parents: 18119
diff changeset
803
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
804 purple_signal_register(handle, "displaying-userinfo",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
805 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
806 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
807 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
808 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
809 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
810 PURPLE_SUBTYPE_USERINFO));
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
811 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
813 void
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
814 purple_notify_uninit(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
815 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
816 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
817 }