Thu, 02 Mar 2023 23:58:21 -0600
Fix leaks in debug window
Fixes two leaks from the debug window:
```
22 bytes in 1 blocks are definitely lost in loss record 7,038 of 41,972
at 0x484386F: malloc (vg_replace_malloc.c:393)
by 0x4980168: g_malloc (gmem.c:130)
by 0x4995602: g_strdup (gstrfuncs.c:363)
by 0x4CFB782: purple_prefs_connect_callback (prefs.c:1301)
by 0x48AA524: pidgin_debug_init (pidgindebug.c:918)
by 0x48B8F9E: pidgin_ui_start (pidginui.c:146)
by 0x4D37B01: purple_ui_start (purpleui.c:397)
by 0x4CE3BA6: purple_core_init (core.c:211)
by 0x48A384F: pidgin_application_startup (pidginapplication.c:820)
by 0x4DD3553: UnknownInlinedFun (gclosure.c:895)
by 0x4DD3553: g_signal_emit_valist (gsignal.c:3456)
by 0x4DD3632: g_signal_emit (gsignal.c:3606)
by 0x5815B82: g_application_register (gapplication.c:2211)
```
and
```
32 bytes in 1 blocks are definitely lost in loss record 15,308 of 41,972
at 0x484386F: malloc (vg_replace_malloc.c:393)
by 0x4980168: g_malloc (gmem.c:130)
by 0x4997AB5: g_slice_alloc (gslice.c:1074)
by 0x495E14C: UnknownInlinedFun (gdatetime.c:678)
by 0x495E14C: g_date_time_from_instant (gdatetime.c:774)
by 0x495F4E9: g_date_time_new_now_local (gdatetime.c:989)
by 0x48A82F9: save_response_cb (pidgindebug.c:136)
by 0x4DB4375: g_cclosure_marshal_VOID__INTv (gmarshal.c:596)
by 0x4DD3553: UnknownInlinedFun (gclosure.c:895)
by 0x4DD3553: g_signal_emit_valist (gsignal.c:3456)
by 0x4DD3632: g_signal_emit (gsignal.c:3606)
by 0x4DB5FBF: g_closure_invoke (gclosure.c:832)
by 0x4DE3D85: signal_emit_unlocked_R.isra.0 (gsignal.c:3796)
by 0x4DD3419: g_signal_emit_valist (gsignal.c:3549)
```
Testing Done:
Ran in valgrind, saved the debug logs to a file, and the above leaks were gone.
Reviewed at https://reviews.imfreedom.org/r/2304/
| 35122 | 1 | /* |
| 2 | * Integration with Unity's messaging menu and launcher | |
| 3 | * Copyright (C) 2013 Ankit Vani <a@nevitus.org> | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or modify | |
| 6 | * it under the terms of the GNU General Public License as published by | |
| 7 | * the Free Software Foundation; either version 2 of the License, or | |
| 8 | * (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
| 18 | */ | |
|
40947
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
19 | #include <glib.h> |
|
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
20 | #include <glib/gi18n-lib.h> |
|
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
21 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
22 | #include <purple.h> |
| 35122 | 23 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | #include <pidgin.h> |
| 35122 | 25 | |
|
40947
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
26 | #include <talkatu.h> |
|
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
27 | |
| 35122 | 28 | #include <unity.h> |
| 29 | #include <messaging-menu.h> | |
| 30 | ||
| 31 | #define UNITY_PLUGIN_ID "gtk-unity-integration" | |
| 32 | ||
| 33 | static MessagingMenuApp *mmapp = NULL; | |
| 34 | static UnityLauncherEntry *launcher = NULL; | |
| 35 | static guint n_sources = 0; | |
| 36 | static gint launcher_count; | |
| 37 | static gint messaging_menu_text; | |
| 38 | static gboolean alert_chat_nick = TRUE; | |
| 39 | ||
| 40 | enum { | |
| 41 | LAUNCHER_COUNT_DISABLE, | |
| 42 | LAUNCHER_COUNT_MESSAGES, | |
| 43 | LAUNCHER_COUNT_SOURCES, | |
| 44 | }; | |
| 45 | ||
| 46 | enum { | |
| 47 | MESSAGING_MENU_COUNT, | |
| 48 | MESSAGING_MENU_TIME, | |
| 49 | }; | |
| 50 | ||
| 51 | static int attach_signals(PurpleConversation *conv); | |
| 52 | static void detach_signals(PurpleConversation *conv); | |
| 53 | ||
| 54 | static void | |
|
41840
fe350460fb1c
Remove C99-obsoleted constructs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41696
diff
changeset
|
55 | update_launcher(void) |
| 35122 | 56 | { |
| 57 | guint count = 0; | |
| 58 | GList *convs = NULL; | |
| 35124 | 59 | g_return_if_fail(launcher != NULL); |
| 60 | if (launcher_count == LAUNCHER_COUNT_DISABLE) | |
| 61 | return; | |
| 35122 | 62 | |
| 63 | if (launcher_count == LAUNCHER_COUNT_MESSAGES) { | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
64 | PurpleConversationManager *manager = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
65 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
66 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
67 | convs = purple_conversation_manager_get_all(manager); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
68 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
69 | while(convs != NULL) { |
| 35122 | 70 | PurpleConversation *conv = convs->data; |
| 35123 | 71 | count += GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), |
| 72 | "unity-message-count")); | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
73 | convs = g_list_delete_link(convs, convs); |
| 35122 | 74 | } |
| 75 | } else { | |
| 76 | count = n_sources; | |
| 77 | } | |
| 78 | ||
| 79 | if (launcher != NULL) { | |
| 80 | if (count > 0) | |
| 81 | unity_launcher_entry_set_count_visible(launcher, TRUE); | |
| 82 | else | |
| 83 | unity_launcher_entry_set_count_visible(launcher, FALSE); | |
| 84 | unity_launcher_entry_set_count(launcher, count); | |
| 85 | } | |
| 86 | } | |
| 87 | ||
| 88 | static gchar * | |
| 89 | conversation_id(PurpleConversation *conv) | |
| 90 | { | |
| 91 | PurpleAccount *account = purple_conversation_get_account(conv); | |
|
41962
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
92 | PurpleContactInfo *info = PURPLE_CONTACT_INFO(account); |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
93 | const char *type = "misc"; |
| 35122 | 94 | |
|
41962
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
95 | if(PURPLE_IS_IM_CONVERSATION(conv)) { |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
96 | type = "im"; |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
97 | } else if(PURPLE_IS_CHAT_CONVERSATION(conv)) { |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
98 | type = "chat"; |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
99 | } |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
100 | |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
101 | return g_strdup_printf("%s:%s:%s:%s", |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
102 | type, |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
103 | purple_conversation_get_name(conv), |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
104 | purple_contact_info_get_username(info), |
|
f802660eaef2
Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
105 | purple_account_get_protocol_id(account)); |
| 35122 | 106 | } |
| 107 | ||
| 108 | static void | |
| 109 | messaging_menu_add_conversation(PurpleConversation *conv, gint count) | |
| 110 | { | |
| 111 | gchar *id; | |
| 112 | g_return_if_fail(count > 0); | |
| 113 | id = conversation_id(conv); | |
| 114 | ||
| 115 | /* GBytesIcon may be useful for messaging menu source icons using buddy | |
| 116 | icon data for IMs */ | |
| 117 | if (!messaging_menu_app_has_source(mmapp, id)) | |
| 118 | messaging_menu_app_append_source(mmapp, id, NULL, | |
| 35123 | 119 | purple_conversation_get_title(conv)); |
| 35122 | 120 | |
| 121 | if (messaging_menu_text == MESSAGING_MENU_TIME) | |
| 122 | messaging_menu_app_set_source_time(mmapp, id, g_get_real_time()); | |
| 123 | else if (messaging_menu_text == MESSAGING_MENU_COUNT) | |
| 124 | messaging_menu_app_set_source_count(mmapp, id, count); | |
| 125 | messaging_menu_app_draw_attention(mmapp, id); | |
| 126 | ||
| 127 | g_free(id); | |
| 128 | } | |
| 129 | ||
| 130 | static void | |
| 131 | messaging_menu_remove_conversation(PurpleConversation *conv) | |
| 132 | { | |
| 133 | gchar *id = conversation_id(conv); | |
| 134 | if (messaging_menu_app_has_source(mmapp, id)) | |
| 135 | messaging_menu_app_remove_source(mmapp, id); | |
| 136 | g_free(id); | |
| 137 | } | |
| 138 | ||
| 139 | static void | |
|
41840
fe350460fb1c
Remove C99-obsoleted constructs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41696
diff
changeset
|
140 | refill_messaging_menu(void) |
| 35122 | 141 | { |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
142 | PurpleConversationManager *manager = NULL; |
| 35122 | 143 | GList *convs; |
| 144 | ||
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
145 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
146 | convs = purple_conversation_manager_get_all(manager); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
147 | while(convs != NULL) { |
| 35122 | 148 | PurpleConversation *conv = convs->data; |
| 149 | messaging_menu_add_conversation(conv, | |
| 35123 | 150 | GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), |
| 151 | "unity-message-count"))); | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
152 | convs = g_list_delete_link(convs, convs); |
| 35122 | 153 | } |
| 154 | } | |
| 155 | ||
| 156 | static int | |
| 157 | alert(PurpleConversation *conv) | |
| 158 | { | |
| 159 | gint count; | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
160 | PidginConversation *gtkconv = NULL; |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
161 | PidginDisplayWindow *displaywin = NULL; |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
162 | GtkRoot *root = NULL; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
163 | GtkWidget *win = NULL; |
|
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
164 | |
| 35122 | 165 | if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) |
| 166 | return 0; | |
| 167 | ||
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
168 | gtkconv = PIDGIN_CONVERSATION(conv); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
169 | root = gtk_widget_get_root(gtkconv->tab_cont); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
170 | win = GTK_WIDGET(root); |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
171 | displaywin = PIDGIN_DISPLAY_WINDOW(win); |
| 35122 | 172 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
173 | if (!gtk_widget_has_focus(win) || |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
174 | !pidgin_display_window_conversation_is_selected(displaywin, conv)) |
| 35122 | 175 | { |
| 35123 | 176 | count = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), |
| 177 | "unity-message-count")); | |
| 35122 | 178 | if (!count++) |
| 179 | ++n_sources; | |
| 180 | ||
| 35123 | 181 | g_object_set_data(G_OBJECT(conv), "unity-message-count", |
| 182 | GINT_TO_POINTER(count)); | |
| 35122 | 183 | messaging_menu_add_conversation(conv, count); |
| 184 | update_launcher(); | |
| 185 | } | |
| 186 | ||
| 187 | return 0; | |
| 188 | } | |
| 189 | ||
| 190 | static void | |
| 191 | unalert(PurpleConversation *conv) | |
| 192 | { | |
| 35123 | 193 | if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-message-count")) > 0) |
| 35122 | 194 | --n_sources; |
| 35123 | 195 | |
| 196 | g_object_set_data(G_OBJECT(conv), "unity-message-count", | |
| 197 | GINT_TO_POINTER(0)); | |
| 35122 | 198 | messaging_menu_remove_conversation(conv); |
| 199 | update_launcher(); | |
| 200 | } | |
| 201 | ||
| 202 | static int | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
203 | unalert_cb(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gpointer data, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
204 | PurpleConversation *conv) |
| 35122 | 205 | { |
| 206 | unalert(conv); | |
| 207 | return 0; | |
| 208 | } | |
| 209 | ||
| 210 | static gboolean | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
211 | message_displayed_cb(PurpleConversation *conv, PurpleMessage *msg, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
212 | G_GNUC_UNUSED gpointer data) |
| 35122 | 213 | { |
|
36110
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36103
diff
changeset
|
214 | PurpleMessageFlags flags = purple_message_get_flags(msg); |
|
63663622e327
Switch write_conv and (displaying|displayed)-(im|chat)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36103
diff
changeset
|
215 | |
| 35123 | 216 | if ((PURPLE_IS_CHAT_CONVERSATION(conv) && alert_chat_nick && |
| 217 | !(flags & PURPLE_MESSAGE_NICK))) | |
| 35122 | 218 | return FALSE; |
| 219 | ||
| 220 | if ((flags & PURPLE_MESSAGE_RECV) && !(flags & PURPLE_MESSAGE_DELAYED)) | |
| 221 | alert(conv); | |
| 222 | ||
| 223 | return FALSE; | |
| 224 | } | |
| 225 | ||
| 226 | static void | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
227 | im_sent_im(PurpleAccount *account, PurpleMessage *msg, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
228 | G_GNUC_UNUSED gpointer data) |
| 35122 | 229 | { |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
230 | PurpleConversation *im = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
231 | PurpleConversationManager *manager = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
232 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
233 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
234 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
235 | im = purple_conversation_manager_find_im(manager, account, |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
236 | purple_message_get_recipient(msg)); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
237 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
238 | unalert(im); |
| 35122 | 239 | } |
| 240 | ||
| 241 | static void | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
242 | chat_sent_im(PurpleAccount *account, G_GNUC_UNUSED PurpleMessage *msg, int id) |
| 35122 | 243 | { |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
244 | PurpleConversation *chat = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
245 | PurpleConversationManager *manager = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
246 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
247 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
248 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
249 | chat = purple_conversation_manager_find_chat_by_id(manager, account, id); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
250 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
251 | unalert(chat); |
| 35122 | 252 | } |
| 253 | ||
| 254 | static void | |
| 255 | conv_created(PurpleConversation *conv) | |
| 256 | { | |
| 35123 | 257 | g_object_set_data(G_OBJECT(conv), "unity-message-count", |
| 258 | GINT_TO_POINTER(0)); | |
| 35122 | 259 | attach_signals(conv); |
| 260 | } | |
| 261 | ||
| 262 | static void | |
| 263 | deleting_conv(PurpleConversation *conv) | |
| 264 | { | |
| 265 | detach_signals(conv); | |
| 266 | unalert(conv); | |
| 267 | } | |
| 268 | ||
| 269 | static void | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
270 | message_source_activated(G_GNUC_UNUSED MessagingMenuApp *app, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
271 | const gchar *id, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
272 | G_GNUC_UNUSED gpointer user_data) |
| 35122 | 273 | { |
| 274 | gchar **sections = g_strsplit(id, ":", 0); | |
| 275 | PurpleConversation *conv = NULL; | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
276 | PurpleConversationManager *conversation_manager = NULL; |
| 35122 | 277 | PurpleAccount *account; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
278 | PurpleAccountManager *account_manager = NULL; |
| 35122 | 279 | |
| 280 | char *type = sections[0]; | |
| 281 | char *cname = sections[1]; | |
| 282 | char *aname = sections[2]; | |
| 283 | char *protocol = sections[3]; | |
| 284 | ||
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
285 | conversation_manager = purple_conversation_manager_get_default(); |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
286 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
287 | account_manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
288 | account = purple_account_manager_find(account_manager, aname, protocol); |
| 35123 | 289 | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
290 | if (g_strcmp0(type, "im") == 0) { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
291 | conv = purple_conversation_manager_find_im(conversation_manager, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
292 | account, cname); |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
293 | } else if (g_strcmp0(type, "chat") == 0) { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
294 | conv = purple_conversation_manager_find_chat(conversation_manager, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
295 | account, cname); |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
296 | } else { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
297 | conv = purple_conversation_manager_find(conversation_manager, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
298 | account, cname); |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
299 | } |
| 35122 | 300 | |
| 301 | if (conv) { | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
302 | GtkRoot *root = NULL; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
303 | GtkWidget *win = NULL; |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
304 | PidginDisplayWindow *displaywin = NULL; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
305 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
306 | root = gtk_widget_get_root(PIDGIN_CONVERSATION(conv)->tab_cont); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
307 | win = GTK_WIDGET(root); |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
308 | displaywin = PIDGIN_DISPLAY_WINDOW(win); |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
309 | |
| 35122 | 310 | unalert(conv); |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41081
diff
changeset
|
311 | |
|
41696
35f8ce475b21
Rename PidginConversationWindow to PidginDisplayWindow as it holds more than conversations now
Gary Kramlich <grim@reaperworld.com>
parents:
41665
diff
changeset
|
312 | pidgin_display_window_select(displaywin, conv); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
313 | |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
314 | gtk_root_set_focus(root, PIDGIN_CONVERSATION(conv)->entry); |
| 35122 | 315 | } |
| 316 | g_strfreev (sections); | |
| 317 | } | |
| 318 | ||
| 319 | static PurpleSavedStatus * | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
320 | create_transient_status(PurpleStatusPrimitive primitive, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
321 | PurpleStatusType *status_type) |
| 35122 | 322 | { |
| 323 | PurpleSavedStatus *saved_status = purple_savedstatus_new(NULL, primitive); | |
| 324 | ||
| 325 | if(status_type != NULL) { | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
326 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
327 | GList *active_accts = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
328 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
329 | manager = purple_account_manager_get_default(); |
|
41454
7cc69bde919d
Update pidgin for the purple_account_manager_get_(in)active deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
41314
diff
changeset
|
330 | active_accts = purple_account_manager_get_enabled(manager); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
331 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
332 | while(active_accts != NULL) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
333 | PurpleAccount *account = PURPLE_ACCOUNT(active_accts->data); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
334 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
335 | purple_savedstatus_set_substatus(saved_status, account, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
336 | status_type, NULL); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
337 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41184
diff
changeset
|
338 | active_accts = g_list_delete_link(active_accts, active_accts); |
| 35122 | 339 | } |
| 340 | } | |
| 341 | ||
| 342 | return saved_status; | |
| 343 | } | |
| 344 | ||
| 345 | static void | |
| 346 | status_changed_cb(PurpleSavedStatus *saved_status) | |
| 347 | { | |
| 348 | MessagingMenuStatus status = MESSAGING_MENU_STATUS_AVAILABLE; | |
| 349 | ||
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35317
diff
changeset
|
350 | switch (purple_savedstatus_get_primitive_type(saved_status)) { |
| 35122 | 351 | case PURPLE_STATUS_AVAILABLE: |
| 352 | case PURPLE_STATUS_MOOD: | |
| 353 | case PURPLE_STATUS_TUNE: | |
| 354 | case PURPLE_STATUS_UNSET: | |
| 355 | status = MESSAGING_MENU_STATUS_AVAILABLE; | |
| 356 | break; | |
| 357 | ||
| 358 | case PURPLE_STATUS_AWAY: | |
| 359 | case PURPLE_STATUS_EXTENDED_AWAY: | |
| 360 | status = MESSAGING_MENU_STATUS_AWAY; | |
| 361 | break; | |
| 362 | ||
| 363 | case PURPLE_STATUS_INVISIBLE: | |
| 364 | status = MESSAGING_MENU_STATUS_INVISIBLE; | |
| 365 | break; | |
| 366 | ||
| 367 | case PURPLE_STATUS_MOBILE: | |
| 368 | case PURPLE_STATUS_OFFLINE: | |
| 369 | status = MESSAGING_MENU_STATUS_OFFLINE; | |
| 370 | break; | |
| 371 | ||
| 372 | case PURPLE_STATUS_UNAVAILABLE: | |
| 373 | status = MESSAGING_MENU_STATUS_BUSY; | |
| 374 | break; | |
| 375 | ||
| 376 | default: | |
| 377 | g_assert_not_reached(); | |
| 378 | } | |
| 379 | messaging_menu_app_set_status(mmapp, status); | |
| 380 | } | |
| 381 | ||
| 382 | static void | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
383 | messaging_menu_status_changed(G_GNUC_UNUSED MessagingMenuApp *mmapp, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
384 | MessagingMenuStatus mm_status, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
385 | G_GNUC_UNUSED gpointer user_data) |
| 35122 | 386 | { |
| 387 | PurpleSavedStatus *saved_status; | |
| 388 | PurpleStatusPrimitive primitive = PURPLE_STATUS_UNSET; | |
| 389 | ||
| 390 | switch (mm_status) { | |
| 391 | case MESSAGING_MENU_STATUS_AVAILABLE: | |
| 392 | primitive = PURPLE_STATUS_AVAILABLE; | |
| 393 | break; | |
| 394 | ||
| 395 | case MESSAGING_MENU_STATUS_AWAY: | |
| 396 | primitive = PURPLE_STATUS_AWAY; | |
| 397 | break; | |
| 398 | ||
| 399 | case MESSAGING_MENU_STATUS_BUSY: | |
| 400 | primitive = PURPLE_STATUS_UNAVAILABLE; | |
| 401 | break; | |
| 402 | ||
| 403 | case MESSAGING_MENU_STATUS_INVISIBLE: | |
| 404 | primitive = PURPLE_STATUS_INVISIBLE; | |
| 405 | break; | |
| 406 | ||
| 407 | case MESSAGING_MENU_STATUS_OFFLINE: | |
| 408 | primitive = PURPLE_STATUS_OFFLINE; | |
| 409 | break; | |
| 410 | ||
| 411 | default: | |
| 412 | g_assert_not_reached(); | |
| 413 | } | |
| 414 | ||
| 415 | saved_status = purple_savedstatus_find_transient_by_type_and_message(primitive, NULL); | |
| 416 | if (saved_status == NULL) | |
| 417 | saved_status = create_transient_status(primitive, NULL); | |
| 418 | purple_savedstatus_activate(saved_status); | |
| 419 | } | |
| 420 | ||
| 421 | static void | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
422 | alert_config_cb(GtkWidget *widget, G_GNUC_UNUSED gpointer data) |
| 35122 | 423 | { |
| 424 | gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); | |
| 425 | purple_prefs_set_bool("/plugins/gtk/unity/alert_chat_nick", on); | |
| 426 | alert_chat_nick = on; | |
| 427 | } | |
| 428 | ||
| 429 | static void | |
| 430 | launcher_config_cb(GtkWidget *widget, gpointer data) | |
| 431 | { | |
| 432 | gint option = GPOINTER_TO_INT(data); | |
| 35124 | 433 | if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
| 434 | return; | |
| 35122 | 435 | |
| 436 | purple_prefs_set_int("/plugins/gtk/unity/launcher_count", option); | |
| 437 | launcher_count = option; | |
| 438 | if (option == LAUNCHER_COUNT_DISABLE) | |
| 439 | unity_launcher_entry_set_count_visible(launcher, FALSE); | |
| 440 | else | |
| 441 | update_launcher(); | |
| 442 | } | |
| 443 | ||
| 444 | static void | |
| 445 | messaging_menu_config_cb(GtkWidget *widget, gpointer data) | |
| 446 | { | |
| 447 | gint option = GPOINTER_TO_INT(data); | |
| 35124 | 448 | if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
| 449 | return; | |
| 35122 | 450 | |
| 451 | purple_prefs_set_int("/plugins/gtk/unity/messaging_menu_text", option); | |
| 452 | messaging_menu_text = option; | |
| 453 | refill_messaging_menu(); | |
| 454 | } | |
| 455 | ||
| 456 | static int | |
| 457 | attach_signals(PurpleConversation *conv) | |
| 458 | { | |
| 459 | PidginConversation *gtkconv = NULL; | |
| 460 | guint id; | |
| 461 | ||
| 462 | gtkconv = PIDGIN_CONVERSATION(conv); | |
| 463 | if (!gtkconv) | |
| 464 | return 0; | |
| 465 | ||
| 466 | id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", | |
| 35123 | 467 | G_CALLBACK(unalert_cb), conv); |
| 468 | g_object_set_data(G_OBJECT(conv), "unity-entry-signal", GUINT_TO_POINTER(id)); | |
| 35122 | 469 | |
|
40947
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
470 | id = g_signal_connect(G_OBJECT(gtkconv->history), "focus-in-event", |
| 35123 | 471 | G_CALLBACK(unalert_cb), conv); |
|
40947
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
472 | g_object_set_data(G_OBJECT(conv), "unity-history-signal", GUINT_TO_POINTER(id)); |
| 35122 | 473 | |
| 474 | return 0; | |
| 475 | } | |
| 476 | ||
| 477 | static void | |
| 478 | detach_signals(PurpleConversation *conv) | |
| 479 | { | |
| 480 | PidginConversation *gtkconv = NULL; | |
| 481 | guint id; | |
| 482 | gtkconv = PIDGIN_CONVERSATION(conv); | |
| 483 | if (!gtkconv) | |
| 484 | return; | |
| 485 | ||
|
40947
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
486 | id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-history-signal")); |
|
4169f8090a0e
Make the unity plugin compile again and add stuff to ci ubuntu builds
Gary Kramlich <grim@reaperworld.com>
parents:
40894
diff
changeset
|
487 | g_signal_handler_disconnect(gtkconv->history, id); |
| 35122 | 488 | |
| 35123 | 489 | id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-entry-signal")); |
| 35122 | 490 | g_signal_handler_disconnect(gtkconv->entry, id); |
| 491 | ||
| 35123 | 492 | g_object_set_data(G_OBJECT(conv), "unity-message-count", |
| 493 | GINT_TO_POINTER(0)); | |
| 35122 | 494 | } |
| 495 | ||
| 496 | static GtkWidget * | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
497 | get_config_frame(G_GNUC_UNUSED PurplePlugin *plugin) |
| 35122 | 498 | { |
| 499 | GtkWidget *ret = NULL, *frame = NULL; | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
500 | GtkWidget *vbox = NULL, *toggle = NULL, *group = NULL; |
| 35122 | 501 | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35378
diff
changeset
|
502 | ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18); |
| 35122 | 503 | |
| 504 | /* Alerts */ | |
| 505 | ||
| 506 | frame = pidgin_make_frame(ret, _("Chatroom alerts")); | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35378
diff
changeset
|
507 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
508 | gtk_box_append(GTK_BOX(frame), vbox); |
| 35122 | 509 | |
| 510 | toggle = gtk_check_button_new_with_mnemonic(_("Chatroom message alerts _only where someone says your username")); | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
511 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
512 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35123 | 513 | purple_prefs_get_bool("/plugins/gtk/unity/alert_chat_nick")); |
| 35122 | 514 | g_signal_connect(G_OBJECT(toggle), "toggled", |
| 35123 | 515 | G_CALLBACK(alert_config_cb), NULL); |
| 35122 | 516 | |
| 517 | /* Launcher integration */ | |
| 518 | ||
| 519 | frame = pidgin_make_frame(ret, _("Launcher Icon")); | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35378
diff
changeset
|
520 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
521 | gtk_box_append(GTK_BOX(frame), vbox); |
| 35122 | 522 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
523 | toggle = gtk_check_button_new_with_mnemonic(_("_Disable launcher integration")); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
524 | group = toggle; |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
525 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
526 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35122 | 527 | purple_prefs_get_int("/plugins/gtk/unity/launcher_count") == LAUNCHER_COUNT_DISABLE); |
| 528 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 35123 | 529 | G_CALLBACK(launcher_config_cb), GUINT_TO_POINTER(LAUNCHER_COUNT_DISABLE)); |
| 35122 | 530 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
531 | toggle = gtk_check_button_new_with_mnemonic( |
| 35123 | 532 | _("Show number of unread _messages on launcher icon")); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
533 | gtk_check_button_set_group(GTK_CHECK_BUTTON(toggle), |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
534 | GTK_CHECK_BUTTON(group)); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
535 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
536 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35122 | 537 | purple_prefs_get_int("/plugins/gtk/unity/launcher_count") == LAUNCHER_COUNT_MESSAGES); |
| 538 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 35123 | 539 | G_CALLBACK(launcher_config_cb), GUINT_TO_POINTER(LAUNCHER_COUNT_MESSAGES)); |
| 35122 | 540 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
541 | toggle = gtk_check_button_new_with_mnemonic( |
|
35317
3c9c77b80a6c
Merge the release-2.x.y branch into default.
Mark Doliner <mark@kingant.net>
diff
changeset
|
542 | _("Show number of unread co_nversations on launcher icon")); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
543 | gtk_check_button_set_group(GTK_CHECK_BUTTON(toggle), |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
544 | GTK_CHECK_BUTTON(group)); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
545 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
546 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35122 | 547 | purple_prefs_get_int("/plugins/gtk/unity/launcher_count") == LAUNCHER_COUNT_SOURCES); |
| 548 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 35123 | 549 | G_CALLBACK(launcher_config_cb), GUINT_TO_POINTER(LAUNCHER_COUNT_SOURCES)); |
| 35122 | 550 | |
| 551 | /* Messaging menu integration */ | |
| 552 | ||
| 553 | frame = pidgin_make_frame(ret, _("Messaging Menu")); | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35378
diff
changeset
|
554 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
555 | gtk_box_append(GTK_BOX(frame), vbox); |
| 35122 | 556 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
557 | toggle = gtk_check_button_new_with_mnemonic( |
| 35123 | 558 | _("Show number of _unread messages for conversations in messaging menu")); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
559 | group = toggle; |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
560 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
561 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35122 | 562 | purple_prefs_get_int("/plugins/gtk/unity/messaging_menu_text") == MESSAGING_MENU_COUNT); |
| 563 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 35123 | 564 | G_CALLBACK(messaging_menu_config_cb), GUINT_TO_POINTER(MESSAGING_MENU_COUNT)); |
| 35122 | 565 | |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
566 | toggle = gtk_check_button_new_with_mnemonic( |
| 35123 | 567 | _("Show _elapsed time for unread conversations in messaging menu")); |
|
41580
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
568 | gtk_check_button_set_group(GTK_CHECK_BUTTON(toggle), |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
569 | GTK_CHECK_BUTTON(group)); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
570 | gtk_box_append(GTK_BOX(vbox), toggle); |
|
787ca853b6c4
Port the unity plugin to gtk4
Gary Kramlich <grim@reaperworld.com>
parents:
41454
diff
changeset
|
571 | gtk_check_button_set_active(GTK_CHECK_BUTTON(toggle), |
| 35122 | 572 | purple_prefs_get_int("/plugins/gtk/unity/messaging_menu_text") == MESSAGING_MENU_TIME); |
| 573 | g_signal_connect(G_OBJECT(toggle), "toggled", | |
| 35123 | 574 | G_CALLBACK(messaging_menu_config_cb), GUINT_TO_POINTER(MESSAGING_MENU_TIME)); |
| 35122 | 575 | |
| 576 | return ret; | |
| 577 | } | |
| 578 | ||
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
579 | static GPluginPluginInfo * |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
580 | unity_query(G_GNUC_UNUSED GError **error) |
|
36969
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
581 | { |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
582 | const gchar * const authors[] = { |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
583 | "Ankit Vani <a@nevitus.org>", |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
584 | NULL |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
585 | }; |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
586 | |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
587 | return pidgin_plugin_info_new( |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
588 | "id", UNITY_PLUGIN_ID, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
589 | "name", N_("Unity Integration"), |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
590 | "version", DISPLAY_VERSION, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
591 | "category", N_("Notification"), |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
592 | "summary", N_("Provides integration with Unity."), |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
593 | "description", N_("Provides integration with Unity's " |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
594 | "messaging menu and launcher."), |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
595 | "authors", authors, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
596 | "website", PURPLE_WEBSITE, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
597 | "abi-version", PURPLE_ABI_VERSION, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
598 | "gtk-config-frame-cb", get_config_frame, |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
599 | NULL |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
600 | ); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
601 | } |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
602 | |
| 35122 | 603 | static gboolean |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
604 | unity_load(GPluginPlugin *plugin, G_GNUC_UNUSED GError **error) { |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
605 | GList *convs = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
606 | PurpleConversationManager *manager = NULL; |
| 35122 | 607 | PurpleSavedStatus *saved_status; |
| 608 | void *conv_handle = purple_conversations_get_handle(); | |
| 609 | void *gtk_conv_handle = pidgin_conversations_get_handle(); | |
| 610 | void *savedstat_handle = purple_savedstatuses_get_handle(); | |
| 611 | ||
|
36969
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
612 | purple_prefs_add_none("/plugins/gtk"); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
613 | purple_prefs_add_none("/plugins/gtk/unity"); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
614 | purple_prefs_add_int("/plugins/gtk/unity/launcher_count", LAUNCHER_COUNT_SOURCES); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
615 | purple_prefs_add_int("/plugins/gtk/unity/messaging_menu_text", MESSAGING_MENU_COUNT); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
616 | purple_prefs_add_bool("/plugins/gtk/unity/alert_chat_nick", TRUE); |
|
c78437610c6d
Refactored unity plugin to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
35125
diff
changeset
|
617 | |
| 35122 | 618 | alert_chat_nick = purple_prefs_get_bool("/plugins/gtk/unity/alert_chat_nick"); |
| 619 | ||
| 620 | mmapp = messaging_menu_app_new("pidgin.desktop"); | |
| 621 | g_object_ref(mmapp); | |
| 622 | messaging_menu_app_register(mmapp); | |
| 623 | messaging_menu_text = purple_prefs_get_int("/plugins/gtk/unity/messaging_menu_text"); | |
| 624 | ||
| 625 | g_signal_connect(mmapp, "activate-source", | |
| 35123 | 626 | G_CALLBACK(message_source_activated), NULL); |
| 35122 | 627 | g_signal_connect(mmapp, "status-changed", |
| 35123 | 628 | G_CALLBACK(messaging_menu_status_changed), NULL); |
| 35122 | 629 | |
| 630 | saved_status = purple_savedstatus_get_current(); | |
| 631 | status_changed_cb(saved_status); | |
| 632 | ||
| 633 | purple_signal_connect(savedstat_handle, "savedstatus-changed", plugin, | |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
634 | G_CALLBACK(status_changed_cb), NULL); |
| 35122 | 635 | |
| 636 | launcher = unity_launcher_entry_get_for_desktop_id("pidgin.desktop"); | |
| 637 | g_object_ref(launcher); | |
| 638 | launcher_count = purple_prefs_get_int("/plugins/gtk/unity/launcher_count"); | |
| 639 | ||
| 640 | purple_signal_connect(gtk_conv_handle, "displayed-im-msg", plugin, | |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
641 | G_CALLBACK(message_displayed_cb), NULL); |
| 35122 | 642 | purple_signal_connect(gtk_conv_handle, "displayed-chat-msg", plugin, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
643 | G_CALLBACK(message_displayed_cb), NULL); |
| 35122 | 644 | purple_signal_connect(conv_handle, "sent-im-msg", plugin, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
645 | G_CALLBACK(im_sent_im), NULL); |
| 35122 | 646 | purple_signal_connect(conv_handle, "sent-chat-msg", plugin, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
647 | G_CALLBACK(chat_sent_im), NULL); |
| 35122 | 648 | purple_signal_connect(conv_handle, "conversation-created", plugin, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
649 | G_CALLBACK(conv_created), NULL); |
| 35122 | 650 | purple_signal_connect(conv_handle, "deleting-conversation", plugin, |
|
41314
0dc72eacd8bf
Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41209
diff
changeset
|
651 | G_CALLBACK(deleting_conv), NULL); |
| 35122 | 652 | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
653 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
654 | convs = purple_conversation_manager_get_all(manager); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
655 | while(convs != NULL) { |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
656 | PurpleConversation *conv = PURPLE_CONVERSATION(convs->data); |
| 35122 | 657 | attach_signals(conv); |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
658 | convs = g_list_delete_link(convs, convs); |
| 35122 | 659 | } |
| 660 | ||
| 661 | return TRUE; | |
| 662 | } | |
| 663 | ||
| 664 | static gboolean | |
|
42074
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
665 | unity_unload(G_GNUC_UNUSED GPluginPlugin *plugin, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
666 | G_GNUC_UNUSED gboolean shutdown, |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
667 | G_GNUC_UNUSED GError **error) |
|
58ae70ad7f21
Mark unused parameters as such for all of the pidgin plugins
Gary Kramlich <grim@reaperworld.com>
parents:
41962
diff
changeset
|
668 | { |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
669 | GList *convs = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
670 | PurpleConversationManager *manager = NULL; |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
671 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
672 | manager = purple_conversation_manager_get_default(); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
673 | convs = purple_conversation_manager_get_all(manager); |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
674 | |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
675 | while(convs != NULL) { |
|
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
676 | PurpleConversation *conv = PURPLE_CONVERSATION(convs->data); |
| 35122 | 677 | unalert(conv); |
| 678 | detach_signals(conv); | |
|
41002
717c8a3f95a3
Update the unity plugin for the PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40947
diff
changeset
|
679 | convs = g_list_delete_link(convs, convs); |
| 35122 | 680 | } |
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
681 | |
| 35122 | 682 | unity_launcher_entry_set_count_visible(launcher, FALSE); |
| 683 | messaging_menu_app_unregister(mmapp); | |
| 684 | ||
| 685 | g_object_unref(launcher); | |
| 686 | g_object_unref(mmapp); | |
| 687 | return TRUE; | |
| 688 | } | |
| 689 | ||
|
40894
80d9d7a73a60
Convert the Pidgin plugins to use GPLUGIN_NATIVE_PLUGIN_DECLARE
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
690 | GPLUGIN_NATIVE_PLUGIN_DECLARE(unity) |