Mon, 12 Sep 2022 22:10:30 -0500
remove purple_user_dir which has been deprecated
Testing Done:
Compiled
Reviewed at https://reviews.imfreedom.org/r/1757/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20137
diff
changeset
|
1 | /* pidgin |
| 9709 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 9709 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19693
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 9709 | 20 | */ |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24541
diff
changeset
|
21 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
22 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
23 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | #endif |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
25 | |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
26 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
27 | |
|
40523
9bcf96663cb9
Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
28 | #include <gst/gst.h> |
|
9bcf96663cb9
Make gstreamer-1.0 a required dependency
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
29 | |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
30 | #include <talkatu.h> |
|
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
31 | |
|
27945
93ece0c6a9ad
Add the MTN revision in the Pidgin About and finch --version dialogs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27941
diff
changeset
|
32 | #include "package_revision.h" |
|
38538
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
33 | #ifdef HAVE_MESON_CONFIG |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
34 | #include "meson-config.h" |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
35 | #endif |
| 9709 | 36 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40240
diff
changeset
|
37 | #include <purple.h> |
| 9709 | 38 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
39 | #include "gtkblist.h" |
| 9709 | 40 | #include "gtkdialogs.h" |
| 41 | #include "gtkutils.h" | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
42 | #include "pidgincore.h" |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40523
diff
changeset
|
43 | #include "pidgindialog.h" |
| 9709 | 44 | |
| 15882 | 45 | struct _PidginGroupMergeObject { |
| 15884 | 46 | PurpleGroup* parent; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
47 | char *new_name; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
48 | }; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
49 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
50 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
51 | pidgin_dialogs_im_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 52 | { |
| 15884 | 53 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
54 | const char *username; |
| 9709 | 55 | |
| 15884 | 56 | account = purple_request_fields_get_account(fields, "account"); |
| 57 | username = purple_request_fields_get_string(fields, "screenname"); | |
| 9709 | 58 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
59 | pidgin_dialogs_im_with_user(account, username); |
| 9709 | 60 | } |
| 61 | ||
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
62 | static gboolean |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
63 | pidgin_dialogs_im_name_validator(PurpleRequestField *field, gchar **errmsg, |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
64 | void *_fields) |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
65 | { |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
66 | PurpleRequestFields *fields = _fields; |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
67 | PurpleAccount *account; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
68 | PurpleProtocol *protocol; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
69 | const char *username; |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
70 | gboolean valid = FALSE; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
71 | |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
72 | account = purple_request_fields_get_account(fields, "account"); |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
73 | protocol = purple_account_get_protocol(account); |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
74 | username = purple_request_fields_get_string(fields, "screenname"); |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
75 | |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
76 | if (username) { |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
77 | valid = purple_validate(protocol, username); |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
78 | } |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
79 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
80 | if (errmsg && !valid) |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
81 | *errmsg = g_strdup(_("Invalid username")); |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
82 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
83 | return valid; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
84 | } |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
85 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
86 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
87 | pidgin_dialogs_im(void) |
| 9709 | 88 | { |
| 15884 | 89 | PurpleRequestFields *fields; |
| 90 | PurpleRequestFieldGroup *group; | |
| 91 | PurpleRequestField *field; | |
| 9709 | 92 | |
| 15884 | 93 | fields = purple_request_fields_new(); |
| 9709 | 94 | |
| 15884 | 95 | group = purple_request_field_group_new(NULL); |
| 96 | purple_request_fields_add_group(fields, group); | |
| 9709 | 97 | |
| 15884 | 98 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 99 | purple_request_field_set_type_hint(field, "screenname"); | |
| 100 | purple_request_field_set_required(field, TRUE); | |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
101 | purple_request_field_set_validator(field, pidgin_dialogs_im_name_validator, fields); |
| 15884 | 102 | purple_request_field_group_add_field(group, field); |
| 9709 | 103 | |
| 15884 | 104 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 105 | purple_request_field_set_type_hint(field, "account"); | |
| 106 | purple_request_field_set_visible(field, | |
| 107 | (purple_connections_get_all() != NULL && | |
| 108 | purple_connections_get_all()->next != NULL)); | |
| 109 | purple_request_field_set_required(field, TRUE); | |
| 110 | purple_request_field_group_add_field(group, field); | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
111 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
112 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
113 | purple_blist_get_default(), _("New Instant Message"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
114 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
115 | "you would like to IM."), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
116 | fields, _("OK"), G_CALLBACK(pidgin_dialogs_im_cb), _("Cancel"), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
117 | NULL, NULL, NULL); |
| 9709 | 118 | } |
| 119 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
120 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
121 | pidgin_dialogs_im_with_user(PurpleAccount *account, const char *username) |
| 9709 | 122 | { |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40803
diff
changeset
|
123 | PurpleConversation *im; |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
124 | PurpleConversationManager *manager; |
| 9709 | 125 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
126 | g_return_if_fail(account != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
127 | g_return_if_fail(username != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
128 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
129 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
130 | im = purple_conversation_manager_find_im(manager, account, username); |
| 9709 | 131 | |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
132 | if(!PURPLE_IS_IM_CONVERSATION(im)) { |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
133 | im = purple_im_conversation_new(account, username); |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
134 | } |
|
12295
b81286b6bc54
[gaim-migrate @ 14599]
Luke Schierer <lschiere@pidgin.im>
parents:
12288
diff
changeset
|
135 | |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40803
diff
changeset
|
136 | pidgin_conv_attach_to_conversation(im); |
|
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40803
diff
changeset
|
137 | purple_conversation_present(im); |
| 9709 | 138 | } |
| 139 | ||
| 140 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
141 | pidgin_dialogs_info_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 142 | { |
| 143 | char *username; | |
| 15884 | 144 | PurpleAccount *account; |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
145 | const gchar *screenname = NULL; |
| 9709 | 146 | |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
147 | account = purple_request_fields_get_account(fields, "account"); |
| 9709 | 148 | |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
149 | screenname = purple_request_fields_get_string(fields, "screenname"); |
|
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
150 | username = g_strdup(purple_normalize(account, screenname)); |
| 9709 | 151 | |
|
41529
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
152 | if(username != NULL && *username != '\0' && account != NULL) { |
|
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
153 | pidgin_retrieve_user_info(purple_account_get_connection(account), |
|
0e835d051f5c
Update gtkdialogs.c for GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41106
diff
changeset
|
154 | username); |
|
40125
a7acc7b00d79
Replace purple_str_has_{prefix,suffix} by g_str_has_{prefix,suffix}.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40064
diff
changeset
|
155 | } |
| 9709 | 156 | |
| 157 | g_free(username); | |
| 158 | } | |
| 159 | ||
| 160 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
161 | pidgin_dialogs_info(void) |
| 9709 | 162 | { |
| 15884 | 163 | PurpleRequestFields *fields; |
| 164 | PurpleRequestFieldGroup *group; | |
| 165 | PurpleRequestField *field; | |
| 9709 | 166 | |
| 15884 | 167 | fields = purple_request_fields_new(); |
| 9709 | 168 | |
| 15884 | 169 | group = purple_request_field_group_new(NULL); |
| 170 | purple_request_fields_add_group(fields, group); | |
| 9709 | 171 | |
| 15884 | 172 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 173 | purple_request_field_set_type_hint(field, "screenname"); | |
| 174 | purple_request_field_set_required(field, TRUE); | |
| 175 | purple_request_field_group_add_field(group, field); | |
| 9709 | 176 | |
| 15884 | 177 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 178 | purple_request_field_set_type_hint(field, "account"); | |
| 179 | purple_request_field_set_visible(field, | |
| 180 | (purple_connections_get_all() != NULL && | |
| 181 | purple_connections_get_all()->next != NULL)); | |
| 182 | purple_request_field_set_required(field, TRUE); | |
| 183 | purple_request_field_group_add_field(group, field); | |
| 9709 | 184 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
185 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
186 | purple_blist_get_default(), _("Get User Info"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
187 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
188 | "whose info you would like to view."), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
189 | fields, _("OK"), G_CALLBACK(pidgin_dialogs_info_cb), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
190 | _("Cancel"), NULL, NULL, NULL); |
| 9709 | 191 | } |
| 192 | ||
| 193 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
194 | pidgin_dialogs_alias_buddy_cb(PurpleBuddy *buddy, const char *new_alias) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
195 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
196 | purple_buddy_set_local_alias(buddy, new_alias); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35469
diff
changeset
|
197 | purple_serv_alias_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
198 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
199 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
200 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
201 | pidgin_dialogs_alias_buddy(PurpleBuddy *buddy) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
202 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
203 | gchar *secondary; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
204 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
205 | g_return_if_fail(buddy != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
206 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
207 | secondary = g_strdup_printf(_("Enter an alias for %s."), purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
208 | |
| 15884 | 209 | purple_request_input(NULL, _("Alias Buddy"), NULL, |
|
34717
b3e588adef5a
Global replace purple_buddy_get_local_buddy_alias() with purple_buddy_get_local_alias()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
210 | secondary, purple_buddy_get_local_alias(buddy), FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
211 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_buddy_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
212 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
213 | purple_request_cpar_from_account(purple_buddy_get_account(buddy)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
214 | buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
215 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
216 | g_free(secondary); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
217 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
218 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
219 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
220 | pidgin_dialogs_alias_chat_cb(PurpleChat *chat, const char *new_alias) |
| 9709 | 221 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
222 | purple_chat_set_alias(chat, new_alias); |
| 9709 | 223 | } |
| 224 | ||
| 225 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
226 | pidgin_dialogs_alias_chat(PurpleChat *chat) |
| 9709 | 227 | { |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
228 | gchar *alias; |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
229 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
230 | g_return_if_fail(chat != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
231 | |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
232 | g_object_get(chat, "alias", &alias, NULL); |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
233 | |
| 15884 | 234 | purple_request_input(NULL, _("Alias Chat"), NULL, |
| 9709 | 235 | _("Enter an alias for this chat."), |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
236 | alias, FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
237 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_chat_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
238 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
239 | purple_request_cpar_from_account(purple_chat_get_account(chat)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
240 | chat); |
|
34923
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
241 | |
|
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
242 | g_free(alias); |
| 9709 | 243 | } |
| 244 | ||
| 245 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
246 | pidgin_dialogs_remove_contact_cb(PurpleContact *contact) |
| 9709 | 247 | { |
| 15884 | 248 | PurpleBlistNode *bnode, *cnode; |
| 249 | PurpleGroup *group; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
250 | |
| 15884 | 251 | cnode = (PurpleBlistNode *)contact; |
| 252 | group = (PurpleGroup*)cnode->parent; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
253 | for (bnode = cnode->child; bnode; bnode = bnode->next) { |
| 15884 | 254 | PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
255 | if (purple_account_is_connected(purple_buddy_get_account(buddy))) |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
256 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
257 | } |
| 15884 | 258 | purple_blist_remove_contact(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
259 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
260 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
261 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
262 | pidgin_dialogs_remove_contact(PurpleContact *contact) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
263 | { |
| 15884 | 264 | PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
265 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
266 | g_return_if_fail(contact != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
267 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
268 | |
|
24976
029a4828431c
Another one the cast fixer breaks.
Richard Laager <rlaager@pidgin.im>
parents:
24569
diff
changeset
|
269 | if (PURPLE_BLIST_NODE(contact)->child == PURPLE_BLIST_NODE(buddy) && |
|
24977
b46bff38cd90
Make my last commit compile.
Richard Laager <rlaager@pidgin.im>
parents:
24976
diff
changeset
|
270 | PURPLE_BLIST_NODE(buddy)->next == NULL) { |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
271 | pidgin_dialogs_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
272 | } else { |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
273 | gchar *text; |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
274 | int contact_size = purple_counting_node_get_total_size(PURPLE_COUNTING_NODE(contact)); |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
275 | text = g_strdup_printf( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
276 | ngettext( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
277 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
278 | "and %d other buddy from your buddy list. Do you " |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
279 | "want to continue?", |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
280 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
281 | "and %d other buddies from your buddy list. Do you " |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
282 | "want to continue?", contact_size - 1), |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
283 | purple_buddy_get_name(buddy), contact_size - 1); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
284 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
285 | purple_request_action(contact, NULL, _("Remove Contact"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
286 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
287 | contact, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
288 | _("_Remove Contact"), G_CALLBACK(pidgin_dialogs_remove_contact_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
289 | _("Cancel"), |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
290 | NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
291 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
292 | g_free(text); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
293 | } |
| 9709 | 294 | } |
| 295 | ||
| 15882 | 296 | static void free_ggmo(struct _PidginGroupMergeObject *ggp) |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
297 | { |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
298 | g_free(ggp->new_name); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
299 | g_free(ggp); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
300 | } |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
301 | |
|
14527
134a695b4fa0
[gaim-migrate @ 17179]
Mark Doliner <markdoliner@pidgin.im>
parents:
14526
diff
changeset
|
302 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
303 | pidgin_dialogs_merge_groups_cb(struct _PidginGroupMergeObject *GGP) |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
304 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
305 | purple_group_set_name(GGP->parent, GGP->new_name); |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
306 | free_ggmo(GGP); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
307 | } |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
308 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
309 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
310 | pidgin_dialogs_merge_groups(PurpleGroup *source, const char *new_name) |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
311 | { |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
312 | gchar *text; |
| 15882 | 313 | struct _PidginGroupMergeObject *ggp; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
314 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
315 | g_return_if_fail(source != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
316 | g_return_if_fail(new_name != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
317 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
318 | text = g_strdup_printf( |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
319 | _("You are about to merge the group called %s into the group " |
|
32712
b0fbaebd28a2
Use the purple_group_get_name() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32709
diff
changeset
|
320 | "called %s. Do you want to continue?"), purple_group_get_name(source), new_name); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
321 | |
| 15882 | 322 | ggp = g_new(struct _PidginGroupMergeObject, 1); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
323 | ggp->parent = source; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
324 | ggp->new_name = g_strdup(new_name); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
325 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
326 | purple_request_action(source, NULL, _("Merge Groups"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
327 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
328 | ggp, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
329 | _("_Merge Groups"), G_CALLBACK(pidgin_dialogs_merge_groups_cb), |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
330 | _("Cancel"), G_CALLBACK(free_ggmo)); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
331 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
332 | g_free(text); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
333 | } |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
334 | |
|
12406
89863d2d9b8d
[gaim-migrate @ 14713]
Richard Laager <rlaager@pidgin.im>
parents:
12374
diff
changeset
|
335 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
336 | pidgin_dialogs_remove_group_cb(PurpleGroup *group) |
| 9709 | 337 | { |
| 15884 | 338 | PurpleBlistNode *cnode, *bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
339 | |
| 15884 | 340 | cnode = ((PurpleBlistNode*)group)->child; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
341 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
342 | while (cnode) { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
343 | if (PURPLE_IS_CONTACT(cnode)) { |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
344 | bnode = cnode->child; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
345 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
346 | while (bnode) { |
| 15884 | 347 | PurpleBuddy *buddy; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
348 | if (PURPLE_IS_BUDDY(bnode)) { |
| 15884 | 349 | buddy = (PurpleBuddy*)bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
350 | bnode = bnode->next; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
351 | if (purple_account_is_connected(purple_buddy_get_account(buddy))) { |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
352 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); |
| 15884 | 353 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
354 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
355 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
356 | bnode = bnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
357 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
358 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
359 | } else if (PURPLE_IS_CHAT(cnode)) { |
| 15884 | 360 | PurpleChat *chat = (PurpleChat *)cnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
361 | cnode = cnode->next; |
|
32713
e5581dd86f9d
Use the PurpleChat accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32712
diff
changeset
|
362 | if (purple_account_is_connected(purple_chat_get_account(chat))) |
| 15884 | 363 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
364 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
365 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
366 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
367 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
368 | |
| 15884 | 369 | purple_blist_remove_group(group); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
370 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
371 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
372 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
373 | pidgin_dialogs_remove_group(PurpleGroup *group) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
374 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
375 | gchar *text; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
376 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
377 | g_return_if_fail(group != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
378 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
379 | text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list. Do you want to continue?"), |
|
32712
b0fbaebd28a2
Use the purple_group_get_name() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32709
diff
changeset
|
380 | purple_group_get_name(group)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
381 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
382 | purple_request_action(group, NULL, _("Remove Group"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
383 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
384 | group, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
385 | _("_Remove Group"), G_CALLBACK(pidgin_dialogs_remove_group_cb), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
386 | _("Cancel"), NULL); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
387 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
388 | g_free(text); |
| 9709 | 389 | } |
| 390 | ||
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10222
diff
changeset
|
391 | /* XXX - Some of this should be moved into the core, methinks. */ |
| 9709 | 392 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
393 | pidgin_dialogs_remove_buddy_cb(PurpleBuddy *buddy) |
| 9709 | 394 | { |
| 15884 | 395 | PurpleGroup *group; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
396 | gchar *name; |
| 15884 | 397 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
398 | |
| 15884 | 399 | group = purple_buddy_get_group(buddy); |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
400 | name = g_strdup(purple_buddy_get_name(buddy)); /* purple_buddy_get_name() is a crasher after remove_buddy */ |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
401 | account = purple_buddy_get_account(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
402 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
403 | purple_debug_info("blist", "Removing '%s' from buddy list.\n", purple_buddy_get_name(buddy)); |
| 15884 | 404 | /* TODO - Should remove from blist first... then call purple_account_remove_buddy()? */ |
|
30706
612b36b49058
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30557
diff
changeset
|
405 | purple_account_remove_buddy(account, buddy, group); |
| 15884 | 406 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
407 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
408 | g_free(name); |
| 9709 | 409 | } |
| 410 | ||
| 411 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
412 | pidgin_dialogs_remove_buddy(PurpleBuddy *buddy) |
| 9709 | 413 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
414 | gchar *text; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
415 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
416 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
417 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
418 | text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
419 | purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
420 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
421 | purple_request_action(buddy, NULL, _("Remove Buddy"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
422 | purple_request_cpar_from_account( |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
423 | purple_buddy_get_account(buddy)), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
424 | buddy, 2, _("_Remove Buddy"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
425 | G_CALLBACK(pidgin_dialogs_remove_buddy_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
426 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
427 | g_free(text); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
428 | } |
| 9709 | 429 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
430 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
431 | pidgin_dialogs_remove_chat_cb(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
432 | { |
| 15884 | 433 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
434 | } |
| 9709 | 435 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
436 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
437 | pidgin_dialogs_remove_chat(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
438 | { |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
439 | const gchar *name; |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
440 | gchar *text; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
441 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
442 | g_return_if_fail(chat != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
443 | |
| 15884 | 444 | name = purple_chat_get_name(chat); |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
445 | text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"), |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
446 | name ? name : ""); |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
447 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
448 | purple_request_action(chat, NULL, _("Remove Chat"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
449 | purple_request_cpar_from_account(purple_chat_get_account(chat)), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
450 | chat, 2, _("_Remove Chat"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
451 | G_CALLBACK(pidgin_dialogs_remove_chat_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
452 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
453 | g_free(text); |
| 9709 | 454 | } |