Fri, 29 Dec 2017 03:57:44 +0000
Merged in rw_grim/pidgin (pull request #297)
Moved PurpleProtocolXfer to xfer.[ch], started a testing ui
Approved-by: Eion Robb <eionrobb@gmail.com>
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* finch |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15908
diff
changeset
|
3 | * Finch is the legal property of its developers, whose names are too numerous |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
5 | * source distribution. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
6 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
10 | * (at your option) any later version. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
11 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
15 | * GNU General Public License for more details. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
16 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
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:
19555
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14555
diff
changeset
|
20 | */ |
|
29106
51c7b2177e42
Fix all the remaining files for which internal.h doesn't end up being the first include.
Paul Aurich <darkrain42@pidgin.im>
parents:
28939
diff
changeset
|
21 | #include <internal.h> |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18134
diff
changeset
|
22 | #include "finch.h" |
|
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18134
diff
changeset
|
23 | |
|
13939
76fa1e736c99
[gaim-migrate @ 16354]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13931
diff
changeset
|
24 | #include <account.h> |
|
34706
02cb08146888
Renamed blist.[ch] to buddylist.[ch]
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
25 | #include <buddylist.h> |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
26 | #include <log.h> |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
27 | #include <notify.h> |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
28 | #include <request.h> |
|
36510
c00f65ba575f
Refactored finch to report plugin load/unload errors
Ankit Vani <a@nevitus.org>
parents:
36490
diff
changeset
|
29 | #include <plugins.h> |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
30 | #include <savedstatuses.h> |
|
13939
76fa1e736c99
[gaim-migrate @ 16354]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13931
diff
changeset
|
31 | #include <server.h> |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
32 | #include <signal.h> |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
33 | #include <status.h> |
|
13939
76fa1e736c99
[gaim-migrate @ 16354]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13931
diff
changeset
|
34 | #include <util.h> |
| 14756 | 35 | #include "debug.h" |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
36 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
37 | #include "gntbox.h" |
|
21804
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
38 | #include "gntcolors.h" |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
39 | #include "gntcombobox.h" |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
40 | #include "gntentry.h" |
|
34910
60502558e400
Replacements for the GObject Xfer API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
41 | #include "gntxfer.h" |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
42 | #include "gntlabel.h" |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
43 | #include "gntline.h" |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
44 | #include "gntlog.h" |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
45 | #include "gntmenu.h" |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
46 | #include "gntmenuitem.h" |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
47 | #include "gntmenuitemcheck.h" |
|
32849
bffb3866bbde
Add support for conversation-extended signals in Finch.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32715
diff
changeset
|
48 | #include "gntmenuutil.h" |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
49 | #include "gntpounce.h" |
|
21804
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
50 | #include "gntstyle.h" |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
51 | #include "gnttree.h" |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
52 | #include "gntutils.h" |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
53 | #include "gntwindow.h" |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
54 | |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
55 | #include "gntblist.h" |
|
14450
1ac2b6e98ef8
[gaim-migrate @ 17094]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14447
diff
changeset
|
56 | #include "gntconv.h" |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
57 | #include "gntstatus.h" |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
58 | #include <string.h> |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
59 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16344
diff
changeset
|
60 | #define PREF_ROOT "/finch/blist" |
|
25732
bdd010ff69fa
*** Plucked rev 143e16e9 (sadrul@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25708
diff
changeset
|
61 | #define TYPING_TIMEOUT_S 4 |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
62 | |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
63 | #define SHOW_EMPTY_GROUP_TIMEOUT 60 |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
64 | |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
65 | typedef struct |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
66 | { |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
67 | GntWidget *window; |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
68 | GntWidget *tree; |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
69 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
70 | GntWidget *tooltip; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34855
diff
changeset
|
71 | PurpleBlistNode *tnode; /* Who is the tooltip being displayed for? */ |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
72 | GList *tagged; /* A list of tagged blistnodes */ |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
73 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
74 | GntWidget *context; |
| 15884 | 75 | PurpleBlistNode *cnode; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
76 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
77 | /* XXX: I am KISSing */ |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
78 | GntWidget *status; /* Dropdown with the statuses */ |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
79 | GntWidget *statustext; /* Status message */ |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
80 | int typing; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
81 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
82 | GntWidget *menu; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
83 | /* These are the menuitems that get regenerated */ |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
84 | GntMenuItem *accounts; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
85 | GntMenuItem *plugins; |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
86 | GntMenuItem *grouping; |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
87 | |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
88 | /* When a new group is manually added, it is empty, but we still want to show it |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
89 | * for a while (SHOW_EMPTY_GROUP_TIMEOUT seconds) even if 'show empty groups' is |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
90 | * not selected. |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
91 | */ |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
92 | GList *new_group; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
93 | guint new_group_timeout; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
94 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
95 | FinchBlistManager *manager; |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
96 | } FinchBlist; |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
97 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
98 | typedef struct |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
99 | { |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
100 | gpointer row; /* the row in the GntTree */ |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
101 | guint signed_timer; /* used when 'recently' signed on/off */ |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
102 | } FinchBlistNode; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
103 | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
104 | typedef enum |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
105 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
106 | STATUS_PRIMITIVE = 0, |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
107 | STATUS_SAVED_POPULAR, |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
108 | STATUS_SAVED_ALL, |
|
14194
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
109 | STATUS_SAVED_NEW |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
110 | } StatusType; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
111 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
112 | typedef struct |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
113 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
114 | StatusType type; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
115 | union |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
116 | { |
| 15884 | 117 | PurpleStatusPrimitive prim; |
| 118 | PurpleSavedStatus *saved; | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
119 | } u; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
120 | } StatusBoxItem; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
121 | |
|
18850
8242ced9d971
We don't need dynamic things here.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18831
diff
changeset
|
122 | static FinchBlist *ggblist; |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
123 | |
| 15884 | 124 | static void add_buddy(PurpleBuddy *buddy, FinchBlist *ggblist); |
| 125 | static void add_contact(PurpleContact *contact, FinchBlist *ggblist); | |
| 126 | static void add_group(PurpleGroup *group, FinchBlist *ggblist); | |
| 127 | static void add_chat(PurpleChat *chat, FinchBlist *ggblist); | |
| 128 | static void add_node(PurpleBlistNode *node, FinchBlist *ggblist); | |
|
17876
e22e8884af80
Fix for the bug Alver reported:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17862
diff
changeset
|
129 | static void node_update(PurpleBuddyList *list, PurpleBlistNode *node); |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
130 | static void draw_tooltip(FinchBlist *ggblist); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
131 | static void tooltip_for_buddy(PurpleBuddy *buddy, GString *str, gboolean full); |
|
14109
1af2b9d5ef3f
[gaim-migrate @ 16660]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14104
diff
changeset
|
132 | static gboolean remove_typing_cb(gpointer null); |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
133 | static void remove_peripherals(FinchBlist *ggblist); |
| 15884 | 134 | static const char * get_display_name(PurpleBlistNode *node); |
| 135 | static void savedstatus_changed(PurpleSavedStatus *now, PurpleSavedStatus *old); | |
| 136 | static void blist_show(PurpleBuddyList *list); | |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
137 | static void update_node_display(PurpleBlistNode *buddy, FinchBlist *ggblist); |
| 15884 | 138 | static void update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist); |
|
30039
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
139 | static gboolean account_autojoin_cb(PurpleConnection *pc, gpointer null); |
|
17295
9bb95ea7e95f
Re-show the add buddy request dialog if something went wrong. It's easy to lose the buddy who just added you otherwise.
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
140 | static void finch_request_add_buddy(PurpleAccount *account, const char *username, const char *grp, const char *alias); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
141 | static void menu_group_set_cb(GntMenuItem *item, gpointer null); |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
142 | |
| 14774 | 143 | /* Sort functions */ |
|
16555
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
144 | static int blist_node_compare_position(PurpleBlistNode *n1, PurpleBlistNode *n2); |
| 15884 | 145 | static int blist_node_compare_text(PurpleBlistNode *n1, PurpleBlistNode *n2); |
| 146 | static int blist_node_compare_status(PurpleBlistNode *n1, PurpleBlistNode *n2); | |
| 147 | static int blist_node_compare_log(PurpleBlistNode *n1, PurpleBlistNode *n2); | |
| 14774 | 148 | |
|
21804
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
149 | static int color_available; |
|
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
150 | static int color_away; |
|
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
151 | static int color_offline; |
|
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
152 | static int color_idle; |
|
931ef2cc7cfb
Add support for colour in gnttreerows, and colourise the blist. Fixes #1490
Richard Nelson <wabz@pidgin.im>
parents:
21630
diff
changeset
|
153 | |
|
35456
821aa4bcb6fa
Fix a bunch of gtk-doc warnings in finch
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
154 | /* |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
155 | * Buddy List Manager functions. |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
156 | */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
157 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
158 | static gboolean default_can_add_node(PurpleBlistNode *node) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
159 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
160 | gboolean offline = purple_prefs_get_bool(PREF_ROOT "/showoffline"); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
161 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
162 | if (PURPLE_IS_BUDDY(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
163 | PurpleBuddy *buddy = (PurpleBuddy*)node; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
164 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
165 | if (!purple_buddy_get_contact(buddy)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
166 | return FALSE; /* When a new buddy is added and show-offline is set */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
167 | if (PURPLE_BUDDY_IS_ONLINE(buddy)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
168 | return TRUE; /* The buddy is online */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
169 | if (!purple_account_is_connected(purple_buddy_get_account(buddy))) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
170 | return FALSE; /* The account is disconnected. Do not show */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
171 | if (offline) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
172 | return TRUE; /* We want to see offline buddies too */ |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
173 | if (fnode && fnode->signed_timer) |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
174 | return TRUE; /* Show if the buddy just signed off */ |
|
22314
850c1c5e24b9
Pay attention to the 'show_offline' setting for the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22312
diff
changeset
|
175 | if (purple_blist_node_get_bool(node, "show_offline")) |
|
850c1c5e24b9
Pay attention to the 'show_offline' setting for the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22312
diff
changeset
|
176 | return TRUE; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
177 | } else if (PURPLE_IS_CONTACT(node)) { |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
178 | PurpleBlistNode *nd; |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
179 | for (nd = purple_blist_node_get_first_child(node); |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
180 | nd; nd = purple_blist_node_get_sibling_next(nd)) { |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
181 | if (default_can_add_node(nd)) |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
182 | return TRUE; |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
183 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
184 | } else if (PURPLE_IS_CHAT(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
185 | PurpleChat *chat = (PurpleChat*)node; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
186 | if (purple_account_is_connected(purple_chat_get_account(chat))) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
187 | return TRUE; /* Show whenever the account is online */ |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
188 | } else if (PURPLE_IS_GROUP(node)) { |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
189 | PurpleBlistNode *nd; |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
190 | gboolean empty = purple_prefs_get_bool(PREF_ROOT "/emptygroups"); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
191 | if (empty) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
192 | return TRUE; /* If we want to see empty groups, we can show any group */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
193 | |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
194 | for (nd = purple_blist_node_get_first_child(node); |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
195 | nd; nd = purple_blist_node_get_sibling_next(nd)) { |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
196 | if (default_can_add_node(nd)) |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
197 | return TRUE; |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
198 | } |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
199 | |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
200 | if (ggblist && ggblist->new_group && g_list_find(ggblist->new_group, node)) |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
201 | return TRUE; |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
202 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
203 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
204 | return FALSE; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
205 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
206 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
207 | static gpointer default_find_parent(PurpleBlistNode *node) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
208 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
209 | gpointer ret = NULL; |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
210 | |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
211 | if (PURPLE_IS_BUDDY(node) || PURPLE_IS_CONTACT(node) || PURPLE_IS_CHAT(node)) |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
212 | ret = purple_blist_node_get_parent(node); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
213 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
214 | if (ret) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
215 | add_node(ret, ggblist); |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
216 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
217 | return ret; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
218 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
219 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
220 | static gboolean default_create_tooltip(gpointer selected_row, GString **body, char **tool_title) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
221 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
222 | GString *str; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
223 | PurpleBlistNode *node = selected_row; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
224 | int lastseen = 0; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
225 | char *title; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
226 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
227 | if (!node || !(PURPLE_IS_BUDDY(node) || PURPLE_IS_CONTACT(node) || |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
228 | PURPLE_IS_GROUP(node) || PURPLE_IS_CHAT(node))) |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
229 | return FALSE; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
230 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
231 | str = g_string_new(""); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
232 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
233 | if (PURPLE_IS_CONTACT(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
234 | PurpleBuddy *pr = purple_contact_get_priority_buddy((PurpleContact*)node); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
235 | gboolean offline = !PURPLE_BUDDY_IS_ONLINE(pr); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
236 | gboolean showoffline = purple_prefs_get_bool(PREF_ROOT "/showoffline"); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
237 | const char *name = purple_buddy_get_name(pr); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
238 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
239 | title = g_strdup(name); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
240 | tooltip_for_buddy(pr, str, TRUE); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
241 | for (node = purple_blist_node_get_first_child(node); node; node = purple_blist_node_get_sibling_next(node)) { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
242 | PurpleBuddy *buddy = (PurpleBuddy*)node; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
243 | if (offline) { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
244 | int value = purple_blist_node_get_int(node, "last_seen"); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
245 | if (value > lastseen) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
246 | lastseen = value; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
247 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
248 | if (node == (PurpleBlistNode*)pr) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
249 | continue; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
250 | if (!purple_account_is_connected(purple_buddy_get_account(buddy))) |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
251 | continue; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
252 | if (!showoffline && !PURPLE_BUDDY_IS_ONLINE(buddy)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
253 | continue; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
254 | str = g_string_append(str, "\n----------\n"); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
255 | tooltip_for_buddy(buddy, str, FALSE); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
256 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
257 | } else if (PURPLE_IS_BUDDY(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
258 | PurpleBuddy *buddy = (PurpleBuddy *)node; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
259 | tooltip_for_buddy(buddy, str, TRUE); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
260 | title = g_strdup(purple_buddy_get_name(buddy)); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
261 | if (!PURPLE_BUDDY_IS_ONLINE((PurpleBuddy*)node)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
262 | lastseen = purple_blist_node_get_int(node, "last_seen"); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
263 | } else if (PURPLE_IS_GROUP(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
264 | PurpleGroup *group = (PurpleGroup *)node; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
265 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
266 | g_string_append_printf(str, _("Online: %d\nTotal: %d"), |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
267 | purple_counting_node_get_online_count(PURPLE_COUNTING_NODE(group)), |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
268 | purple_counting_node_get_current_size(PURPLE_COUNTING_NODE(group))); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
269 | |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
270 | title = g_strdup(purple_group_get_name(group)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
271 | } else if (PURPLE_IS_CHAT(node)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
272 | PurpleChat *chat = (PurpleChat *)node; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
273 | PurpleAccount *account = purple_chat_get_account(chat); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
274 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
275 | g_string_append_printf(str, _("Account: %s (%s)"), |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
276 | purple_account_get_username(account), |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
277 | purple_account_get_protocol_name(account)); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
278 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
279 | title = g_strdup(purple_chat_get_name(chat)); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
280 | } else { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
281 | g_string_free(str, TRUE); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
282 | return FALSE; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
283 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
284 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
285 | if (lastseen > 0) { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
286 | char *tmp = purple_str_seconds_to_string(time(NULL) - lastseen); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
287 | g_string_append_printf(str, _("\nLast Seen: %s ago"), tmp); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
288 | g_free(tmp); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
289 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
290 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
291 | if (tool_title) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
292 | *tool_title = title; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
293 | else |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
294 | g_free(title); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
295 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
296 | if (body) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
297 | *body = str; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
298 | else |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
299 | g_string_free(str, TRUE); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
300 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
301 | return TRUE; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
302 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
303 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
304 | static FinchBlistManager default_manager = |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
305 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
306 | "default", |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
307 | N_("Default"), |
|
22312
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
308 | NULL, |
|
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
309 | NULL, |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
310 | default_can_add_node, |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
311 | default_find_parent, |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
312 | default_create_tooltip, |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
313 | {NULL, NULL, NULL, NULL} |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
314 | }; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
315 | static GList *managers; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
316 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
317 | static FinchBlistNode * |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
318 | create_finch_blist_node(PurpleBlistNode *node, gpointer row) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
319 | { |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
320 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
321 | if (!fnode) { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
322 | fnode = g_new0(FinchBlistNode, 1); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
323 | fnode->signed_timer = 0; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
324 | purple_blist_node_set_ui_data(node, fnode); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
325 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
326 | fnode->row = row; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
327 | return fnode; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
328 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
329 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
330 | static void |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
331 | reset_blist_node_ui_data(PurpleBlistNode *node) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
332 | { |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
333 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
334 | if (fnode == NULL) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
335 | return; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
336 | if (fnode->signed_timer) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
337 | g_source_remove(fnode->signed_timer); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
338 | g_free(fnode); |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
339 | purple_blist_node_set_ui_data(node, NULL); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
340 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
341 | |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
342 | static int |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
343 | get_display_color(PurpleBlistNode *node) |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
344 | { |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
345 | PurpleBuddy *buddy; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
346 | int color = 0; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
347 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
348 | if (PURPLE_IS_CONTACT(node)) |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
349 | node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
350 | if (!PURPLE_IS_BUDDY(node)) |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
351 | return 0; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
352 | |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
353 | buddy = (PurpleBuddy*)node; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
354 | if (purple_presence_is_idle(purple_buddy_get_presence(buddy))) { |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
355 | color = color_idle; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
356 | } else if (purple_presence_is_available(purple_buddy_get_presence(buddy))) { |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
357 | color = color_available; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
358 | } else if (purple_presence_is_online(purple_buddy_get_presence(buddy)) && |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
359 | !purple_presence_is_available(purple_buddy_get_presence(buddy))) { |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
360 | color = color_away; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
361 | } else if (!purple_presence_is_online(purple_buddy_get_presence(buddy))) { |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
362 | color = color_offline; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
363 | } |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
364 | |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
365 | return color; |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
366 | } |
|
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
367 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
368 | static GntTextFormatFlags |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
369 | get_blist_node_flag(PurpleBlistNode *node) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
370 | { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
371 | GntTextFormatFlags flag = 0; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
372 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
373 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
374 | if (ggblist->tagged && g_list_find(ggblist->tagged, node)) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
375 | flag |= GNT_TEXT_FLAG_BOLD; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
376 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
377 | if (fnode && fnode->signed_timer) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
378 | flag |= GNT_TEXT_FLAG_BLINK; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
379 | else if (PURPLE_IS_CONTACT(node)) { |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
380 | node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
381 | fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
382 | if (fnode && fnode->signed_timer) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
383 | flag |= GNT_TEXT_FLAG_BLINK; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
384 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
385 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
386 | return flag; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
387 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
388 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
389 | static void |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
390 | blist_update_row_flags(PurpleBlistNode *node) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
391 | { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
392 | gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), node, get_blist_node_flag(node)); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
393 | gnt_tree_set_row_color(GNT_TREE(ggblist->tree), node, get_display_color(node)); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
394 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
395 | |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
396 | static void |
| 15884 | 397 | new_node(PurpleBlistNode *node) |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
398 | { |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
399 | } |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
400 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
401 | static void |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
402 | add_node(PurpleBlistNode *node, FinchBlist *ggblist) |
|
13927
c2f57a00bc1f
[gaim-migrate @ 16331]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13926
diff
changeset
|
403 | { |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
404 | if (purple_blist_node_get_ui_data(node)) |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
405 | return; |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
406 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
407 | if (!ggblist->manager->can_add_node(node)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
408 | return; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
409 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
410 | if (PURPLE_IS_BUDDY(node)) |
| 15884 | 411 | add_buddy((PurpleBuddy*)node, ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
412 | else if (PURPLE_IS_CONTACT(node)) |
| 15884 | 413 | add_contact((PurpleContact*)node, ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
414 | else if (PURPLE_IS_GROUP(node)) |
| 15884 | 415 | add_group((PurpleGroup*)node, ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
416 | else if (PURPLE_IS_CHAT(node)) |
| 15884 | 417 | add_chat((PurpleChat *)node, ggblist); |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
418 | |
|
13927
c2f57a00bc1f
[gaim-migrate @ 16331]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13926
diff
changeset
|
419 | draw_tooltip(ggblist); |
|
c2f57a00bc1f
[gaim-migrate @ 16331]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13926
diff
changeset
|
420 | } |
|
c2f57a00bc1f
[gaim-migrate @ 16331]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13926
diff
changeset
|
421 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
422 | void finch_blist_manager_add_node(PurpleBlistNode *node) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
423 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
424 | add_node(node, ggblist); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
425 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
426 | |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
427 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
428 | remove_tooltip(FinchBlist *ggblist) |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
429 | { |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
430 | gnt_widget_destroy(ggblist->tooltip); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
431 | ggblist->tooltip = NULL; |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
432 | ggblist->tnode = NULL; |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
433 | } |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
434 | |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
435 | static void |
| 15884 | 436 | node_remove(PurpleBuddyList *list, PurpleBlistNode *node) |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
437 | { |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
438 | FinchBlist *ggblist = FINCH_GET_DATA(list); |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
439 | PurpleBlistNode *parent; |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
440 | |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
441 | if (ggblist == NULL || purple_blist_node_get_ui_data(node) == NULL) |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
442 | return; |
|
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
443 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
444 | if (PURPLE_IS_GROUP(node) && ggblist->new_group) { |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
445 | ggblist->new_group = g_list_remove(ggblist->new_group, node); |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
446 | } |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
447 | |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
448 | gnt_tree_remove(GNT_TREE(ggblist->tree), node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
449 | reset_blist_node_ui_data(node); |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
450 | if (ggblist->tagged) |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
451 | ggblist->tagged = g_list_remove(ggblist->tagged, node); |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
452 | |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
453 | parent = purple_blist_node_get_parent(node); |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
454 | for (node = purple_blist_node_get_first_child(node); node; |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
455 | node = purple_blist_node_get_sibling_next(node)) |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
456 | node_remove(list, node); |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
457 | |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
458 | if (parent) { |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
459 | if (!ggblist->manager->can_add_node(parent)) |
|
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
460 | node_remove(list, parent); |
|
17876
e22e8884af80
Fix for the bug Alver reported:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17862
diff
changeset
|
461 | else |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
462 | node_update(list, parent); |
|
13919
94caf5dc02b4
[gaim-migrate @ 16316]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13915
diff
changeset
|
463 | } |
| 14910 | 464 | |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
465 | draw_tooltip(ggblist); |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
466 | } |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
467 | |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
468 | static void |
| 15884 | 469 | node_update(PurpleBuddyList *list, PurpleBlistNode *node) |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
470 | { |
| 14455 | 471 | /* It really looks like this should never happen ... but it does. |
| 472 | This will at least emit a warning to the log when it | |
| 473 | happens, so maybe someone will figure it out. */ | |
| 474 | g_return_if_fail(node != NULL); | |
| 475 | ||
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
476 | if (FINCH_GET_DATA(list)== NULL) |
|
14458
b49cf8395bfa
[gaim-migrate @ 17104]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14455
diff
changeset
|
477 | return; /* XXX: this is probably the place to auto-join chats */ |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
478 | |
|
17862
32f49f3a139a
Fix a crash exposed by nullprpl.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17845
diff
changeset
|
479 | if (ggblist->window == NULL) |
|
32f49f3a139a
Fix a crash exposed by nullprpl.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17845
diff
changeset
|
480 | return; |
|
32f49f3a139a
Fix a crash exposed by nullprpl.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17845
diff
changeset
|
481 | |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
482 | if (purple_blist_node_get_ui_data(node)!= NULL) { |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
483 | gnt_tree_change_text(GNT_TREE(ggblist->tree), node, |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
484 | 0, get_display_name(node)); |
| 14774 | 485 | gnt_tree_sort_row(GNT_TREE(ggblist->tree), node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
486 | blist_update_row_flags(node); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
487 | if (gnt_tree_get_parent_key(GNT_TREE(ggblist->tree), node) != |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
488 | ggblist->manager->find_parent(node)) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
489 | node_remove(list, node); |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
490 | } |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
491 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
492 | if (PURPLE_IS_BUDDY(node)) { |
| 15884 | 493 | PurpleBuddy *buddy = (PurpleBuddy*)node; |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
494 | add_node((PurpleBlistNode*)buddy, FINCH_GET_DATA(list)); |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
495 | node_update(list, purple_blist_node_get_parent(node)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
496 | } else if (PURPLE_IS_CHAT(node)) { |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
497 | add_node(node, FINCH_GET_DATA(list)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
498 | } else if (PURPLE_IS_CONTACT(node)) { |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
499 | if (purple_blist_node_get_ui_data(node)== NULL) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
500 | /* The core seems to expect the UI to add the buddies. */ |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
501 | for (node = purple_blist_node_get_first_child(node); node; node = purple_blist_node_get_sibling_next(node)) |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
502 | add_node(node, FINCH_GET_DATA(list)); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
503 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
504 | } else if (PURPLE_IS_GROUP(node)) { |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
505 | if (!ggblist->manager->can_add_node(node)) |
|
14469
3b398f75a695
[gaim-migrate @ 17115]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14467
diff
changeset
|
506 | node_remove(list, node); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
507 | else |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
508 | add_node(node, FINCH_GET_DATA(list)); |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
509 | } |
|
24198
a8cf4ef3982a
Update the tooltip if the status of the selected node changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23485
diff
changeset
|
510 | if (ggblist->tnode == node) { |
|
a8cf4ef3982a
Update the tooltip if the status of the selected node changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23485
diff
changeset
|
511 | draw_tooltip(ggblist); |
|
a8cf4ef3982a
Update the tooltip if the status of the selected node changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23485
diff
changeset
|
512 | } |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
513 | } |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
514 | |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
515 | static void |
| 15884 | 516 | new_list(PurpleBuddyList *list) |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
517 | { |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
518 | if (ggblist) |
|
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
519 | return; |
|
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
520 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
521 | ggblist = g_new0(FinchBlist, 1); |
|
22339
f68309ed6c0a
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22336
diff
changeset
|
522 | FINCH_SET_DATA(list, ggblist); |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
523 | ggblist->manager = finch_blist_manager_find(purple_prefs_get_string(PREF_ROOT "/grouping")); |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
524 | if (!ggblist->manager) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
525 | ggblist->manager = &default_manager; |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
526 | } |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
527 | |
|
28088
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
528 | static void destroy_list(PurpleBuddyList *list) |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
529 | { |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
530 | if (ggblist == NULL) |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
531 | return; |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
532 | |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
533 | gnt_widget_destroy(ggblist->window); |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
534 | g_free(ggblist); |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
535 | ggblist = NULL; |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
536 | } |
|
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
537 | |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
538 | static gboolean |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
539 | remove_new_empty_group(gpointer data) |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
540 | { |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
541 | PurpleBuddyList *list; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
542 | |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
543 | if (!ggblist) |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
544 | return FALSE; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
545 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
546 | list = purple_blist_get_buddy_list(); |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
547 | g_return_val_if_fail(list, FALSE); |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
548 | |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
549 | ggblist->new_group_timeout = 0; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
550 | while (ggblist->new_group) { |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
551 | PurpleBlistNode *group = ggblist->new_group->data; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
552 | ggblist->new_group = g_list_delete_link(ggblist->new_group, ggblist->new_group); |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
553 | node_update(list, group); |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
554 | } |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
555 | |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
556 | return FALSE; |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
557 | } |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
558 | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
559 | static void |
| 15884 | 560 | add_buddy_cb(void *data, PurpleRequestFields *allfields) |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
561 | { |
| 15884 | 562 | const char *username = purple_request_fields_get_string(allfields, "screenname"); |
| 563 | const char *alias = purple_request_fields_get_string(allfields, "alias"); | |
| 564 | const char *group = purple_request_fields_get_string(allfields, "group"); | |
|
31601
8aa82480b972
Show invite message entry in Finch's Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
565 | const char *invite = purple_request_fields_get_string(allfields, "invite"); |
| 15884 | 566 | PurpleAccount *account = purple_request_fields_get_account(allfields, "account"); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
567 | const char *error = NULL; |
| 15884 | 568 | PurpleGroup *grp; |
| 569 | PurpleBuddy *buddy; | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
570 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
571 | if (!username) |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22935
diff
changeset
|
572 | error = _("You must provide a username for the buddy."); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
573 | else if (!group) |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
574 | error = _("You must provide a group."); |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
575 | else if (!account) |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
576 | error = _("You must select an account."); |
|
16982
febd8a44dce7
Show an error message when trying to add a buddy from an offline account.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16981
diff
changeset
|
577 | else if (!purple_account_is_connected(account)) |
|
febd8a44dce7
Show an error message when trying to add a buddy from an offline account.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16981
diff
changeset
|
578 | error = _("The selected account is not online."); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
579 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
580 | if (error) |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
581 | { |
|
17295
9bb95ea7e95f
Re-show the add buddy request dialog if something went wrong. It's easy to lose the buddy who just added you otherwise.
Richard Nelson <wabz@pidgin.im>
parents:
17164
diff
changeset
|
582 | finch_request_add_buddy(account, username, group, alias); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34338
diff
changeset
|
583 | purple_notify_error(NULL, _("Error"), _("Error adding buddy"), |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34338
diff
changeset
|
584 | error, purple_request_cpar_from_account(account)); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
585 | return; |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
586 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
587 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
588 | grp = purple_blist_find_group(group); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
589 | if (!grp) |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
590 | { |
| 15884 | 591 | grp = purple_group_new(group); |
| 592 | purple_blist_add_group(grp, NULL); | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
593 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
594 | |
|
24867
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
595 | /* XXX: Ask to merge if there's already a buddy with the same alias in the same group (#4553) */ |
|
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
596 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
597 | if ((buddy = purple_blist_find_buddy_in_group(account, username, grp)) == NULL) |
|
24867
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
598 | { |
|
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
599 | buddy = purple_buddy_new(account, username, alias); |
|
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
600 | purple_blist_add_buddy(buddy, NULL, grp, NULL); |
|
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
601 | } |
|
69105eeaf010
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <darkrain42@pidgin.im>
parents:
24799
diff
changeset
|
602 | |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32287
diff
changeset
|
603 | purple_account_add_buddy(account, buddy, invite); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
604 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
605 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
606 | static void |
| 15884 | 607 | finch_request_add_buddy(PurpleAccount *account, const char *username, const char *grp, const char *alias) |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
608 | { |
| 15884 | 609 | PurpleRequestFields *fields = purple_request_fields_new(); |
| 610 | PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); | |
| 611 | PurpleRequestField *field; | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
612 | |
| 15884 | 613 | purple_request_fields_add_group(fields, group); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
614 | |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22935
diff
changeset
|
615 | field = purple_request_field_string_new("screenname", _("Username"), username, FALSE); |
| 15884 | 616 | purple_request_field_group_add_field(group, field); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
617 | |
|
22431
06ae5eb33844
Right-clicking on a widget should trigger the context-menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22379
diff
changeset
|
618 | field = purple_request_field_string_new("alias", _("Alias (optional)"), alias, FALSE); |
| 15884 | 619 | purple_request_field_group_add_field(group, field); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
620 | |
|
31601
8aa82480b972
Show invite message entry in Finch's Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
621 | field = purple_request_field_string_new("invite", _("Invite message (optional)"), NULL, FALSE); |
|
8aa82480b972
Show invite message entry in Finch's Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
622 | purple_request_field_group_add_field(group, field); |
|
8aa82480b972
Show invite message entry in Finch's Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
623 | |
|
22431
06ae5eb33844
Right-clicking on a widget should trigger the context-menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22379
diff
changeset
|
624 | field = purple_request_field_string_new("group", _("Add in group"), grp, FALSE); |
| 15884 | 625 | purple_request_field_group_add_field(group, field); |
|
15908
d5b3f76ff418
Group autocomplete for buddy adding
Richard Nelson <wabz@pidgin.im>
parents:
15906
diff
changeset
|
626 | purple_request_field_set_type_hint(field, "group"); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
627 | |
| 15884 | 628 | field = purple_request_field_account_new("account", _("Account"), NULL); |
| 629 | purple_request_field_account_set_show_all(field, FALSE); | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
630 | if (account) |
| 15884 | 631 | purple_request_field_account_set_value(field, account); |
| 632 | purple_request_field_group_add_field(group, field); | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
633 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
634 | purple_request_fields(NULL, _("Add Buddy"), NULL, _("Please enter buddy information."), |
|
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:
16478
diff
changeset
|
635 | fields, |
|
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:
16478
diff
changeset
|
636 | _("Add"), G_CALLBACK(add_buddy_cb), |
|
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:
16478
diff
changeset
|
637 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
638 | purple_request_cpar_from_account(account), |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
639 | NULL); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
640 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
641 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
642 | static void |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
643 | join_chat(PurpleChat *chat) |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
644 | { |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
645 | PurpleAccount *account = purple_chat_get_account(chat); |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
646 | const char *name; |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
647 | PurpleChatConversation *conv; |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
648 | |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
649 | name = purple_chat_get_name_only(chat); |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
650 | conv = purple_conversations_find_chat_with_account(name, account); |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
651 | |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
652 | if (!conv || purple_chat_conversation_has_left(conv)) { |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
653 | purple_serv_join_chat(purple_account_get_connection(account), |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
654 | purple_chat_get_components(chat)); |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
655 | } else if (conv) { |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
656 | purple_conversation_present(PURPLE_CONVERSATION(conv)); |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
657 | } |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
658 | } |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
659 | |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
660 | static void |
| 15884 | 661 | add_chat_cb(void *data, PurpleRequestFields *allfields) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
662 | { |
| 15884 | 663 | PurpleAccount *account; |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
664 | const char *alias, *name, *group; |
| 15884 | 665 | PurpleChat *chat; |
| 666 | PurpleGroup *grp; | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
667 | GHashTable *hash = NULL; |
| 15884 | 668 | PurpleConnection *gc; |
|
18852
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
669 | gboolean autojoin; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
670 | PurpleProtocol *protocol; |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
671 | |
| 15884 | 672 | account = purple_request_fields_get_account(allfields, "account"); |
| 673 | name = purple_request_fields_get_string(allfields, "name"); | |
| 674 | alias = purple_request_fields_get_string(allfields, "alias"); | |
| 675 | group = purple_request_fields_get_string(allfields, "group"); | |
|
18852
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
676 | autojoin = purple_request_fields_get_bool(allfields, "autojoin"); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
677 | |
| 15884 | 678 | if (!purple_account_is_connected(account) || !name || !*name) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
679 | return; |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22335
diff
changeset
|
680 | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
681 | if (!group || !*group) |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
682 | group = _("Chats"); |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
683 | |
| 15884 | 684 | gc = purple_account_get_connection(account); |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
685 | protocol = purple_connection_get_protocol(gc); |
| 36719 | 686 | hash = purple_protocol_chat_iface_info_defaults(protocol, gc, name); |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22335
diff
changeset
|
687 | |
| 15884 | 688 | chat = purple_chat_new(account, name, hash); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
689 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
690 | if (chat != NULL) { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
691 | if ((grp = purple_blist_find_group(group)) == NULL) { |
| 15884 | 692 | grp = purple_group_new(group); |
| 693 | purple_blist_add_group(grp, NULL); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
694 | } |
| 15884 | 695 | purple_blist_add_chat(chat, grp, NULL); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
696 | purple_chat_set_alias(chat, alias); |
|
18852
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
697 | purple_blist_node_set_bool((PurpleBlistNode*)chat, "gnt-autojoin", autojoin); |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
698 | if (autojoin) { |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
699 | join_chat(chat); |
|
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
700 | } |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
701 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
702 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
703 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
704 | static void |
| 15884 | 705 | finch_request_add_chat(PurpleAccount *account, PurpleGroup *grp, const char *alias, const char *name) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
706 | { |
| 15884 | 707 | PurpleRequestFields *fields = purple_request_fields_new(); |
| 708 | PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); | |
| 709 | PurpleRequestField *field; | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
710 | |
| 15884 | 711 | purple_request_fields_add_group(fields, group); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
712 | |
| 15884 | 713 | field = purple_request_field_account_new("account", _("Account"), NULL); |
| 714 | purple_request_field_account_set_show_all(field, FALSE); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
715 | if (account) |
| 15884 | 716 | purple_request_field_account_set_value(field, account); |
| 717 | purple_request_field_group_add_field(group, field); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
718 | |
| 15884 | 719 | field = purple_request_field_string_new("name", _("Name"), name, FALSE); |
| 720 | purple_request_field_group_add_field(group, field); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
721 | |
| 15884 | 722 | field = purple_request_field_string_new("alias", _("Alias"), alias, FALSE); |
| 723 | purple_request_field_group_add_field(group, field); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
724 | |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
725 | field = purple_request_field_string_new("group", _("Group"), grp ? purple_group_get_name(grp) : NULL, FALSE); |
| 15884 | 726 | purple_request_field_group_add_field(group, field); |
|
22976
df744a1b1bbe
Setup tab-completion for groups in the 'Add Chat' dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22942
diff
changeset
|
727 | purple_request_field_set_type_hint(field, "group"); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
728 | |
|
18852
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
729 | field = purple_request_field_bool_new("autojoin", _("Auto-join"), FALSE); |
|
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
730 | purple_request_field_group_add_field(group, field); |
|
cc1891434459
Add an 'auto-join' checkbox in the 'Add Chat' dialog, thanks to fmoo's
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18851
diff
changeset
|
731 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
732 | purple_request_fields(NULL, _("Add Chat"), NULL, |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
733 | _("You can edit more information from the context menu later."), |
|
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:
16478
diff
changeset
|
734 | fields, _("Add"), G_CALLBACK(add_chat_cb), _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
735 | NULL, NULL); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
736 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
737 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
738 | static void |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
739 | add_group_cb(gpointer null, const char *group) |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
740 | { |
| 15884 | 741 | PurpleGroup *grp; |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
742 | |
|
24458
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
743 | if (!group || !*group) { |
| 15884 | 744 | purple_notify_error(NULL, _("Error"), _("Error adding group"), |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34338
diff
changeset
|
745 | _("You must give a name for the group to add."), NULL); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
746 | return; |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
747 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
748 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
749 | grp = purple_blist_find_group(group); |
|
24458
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
750 | if (!grp) { |
| 15884 | 751 | grp = purple_group_new(group); |
| 752 | purple_blist_add_group(grp, NULL); | |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
753 | } |
|
24458
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
754 | |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
755 | if (!ggblist) |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
756 | return; |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
757 | |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
758 | /* Treat the group as a new group even if it had existed before. This should |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
759 | * make things easier to add buddies to empty groups (new or old) without having |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
760 | * to turn on 'show empty groups' setting */ |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
761 | ggblist->new_group = g_list_prepend(ggblist->new_group, grp); |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
762 | if (ggblist->new_group_timeout) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
763 | g_source_remove(ggblist->new_group_timeout); |
|
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
764 | ggblist->new_group_timeout = g_timeout_add_seconds(SHOW_EMPTY_GROUP_TIMEOUT, |
|
24458
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
765 | remove_new_empty_group, NULL); |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
766 | |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
767 | /* Select the group */ |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
768 | if (ggblist->tree) { |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
769 | FinchBlistNode *fnode = purple_blist_node_get_ui_data((PurpleBlistNode*)grp); |
|
24458
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
770 | if (!fnode) |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
771 | add_node((PurpleBlistNode*)grp, ggblist); |
|
7706c9b08d5e
Instead of showing error message when trying to interactively add an
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24450
diff
changeset
|
772 | gnt_tree_set_selected(GNT_TREE(ggblist->tree), grp); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
773 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
774 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
775 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
776 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
777 | finch_request_add_group(void) |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
778 | { |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
779 | purple_request_input(NULL, _("Add Group"), NULL, _("Enter the name of the group"), |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
780 | NULL, FALSE, FALSE, 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:
16478
diff
changeset
|
781 | _("Add"), G_CALLBACK(add_group_cb), _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33935
diff
changeset
|
782 | NULL, NULL); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
783 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
784 | |
| 15884 | 785 | static PurpleBlistUiOps blist_ui_ops = |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
786 | { |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
787 | new_list, |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
788 | new_node, |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
789 | blist_show, |
|
14447
32f854416012
[gaim-migrate @ 17091]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14446
diff
changeset
|
790 | node_update, |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
791 | node_remove, |
|
28088
158b4891a151
Fix a crash at shutdown in Finch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27829
diff
changeset
|
792 | destroy_list, |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
793 | NULL, |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
794 | finch_request_add_buddy, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
795 | finch_request_add_chat, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
796 | finch_request_add_group, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
797 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
798 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
17018
diff
changeset
|
799 | NULL, |
|
35024
eb3afb7643ce
Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
800 | NULL, NULL, NULL, NULL |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
801 | }; |
|
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
802 | |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
803 | static gpointer |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
804 | finch_blist_get_handle(void) |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
805 | { |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
806 | static int handle; |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
807 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
808 | return &handle; |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
809 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
810 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
811 | static void |
| 15884 | 812 | add_group(PurpleGroup *group, FinchBlist *ggblist) |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
813 | { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
814 | gpointer parent; |
| 15884 | 815 | PurpleBlistNode *node = (PurpleBlistNode *)group; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
816 | if (purple_blist_node_get_ui_data(node)) |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
817 | return; |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
818 | parent = ggblist->manager->find_parent((PurpleBlistNode*)group); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
819 | create_finch_blist_node(node, gnt_tree_add_row_after(GNT_TREE(ggblist->tree), group, |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
820 | gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
821 | parent, NULL)); |
|
16165
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
822 | gnt_tree_set_expanded(GNT_TREE(ggblist->tree), node, |
|
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
823 | !purple_blist_node_get_bool(node, "collapsed")); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
824 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
825 | |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
826 | static const char * |
| 15884 | 827 | get_display_name(PurpleBlistNode *node) |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
828 | { |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
829 | static char text[2096]; |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
830 | char status[8] = " "; |
|
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
831 | const char *name = NULL; |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
832 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
833 | if (PURPLE_IS_CONTACT(node)) |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
834 | node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); /* XXX: this can return NULL?! */ |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
835 | |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
836 | if (node == NULL) |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
837 | return NULL; |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
838 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
839 | if (PURPLE_IS_BUDDY(node)) |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
840 | { |
| 15884 | 841 | PurpleBuddy *buddy = (PurpleBuddy *)node; |
| 842 | PurpleStatusPrimitive prim; | |
| 843 | PurplePresence *presence; | |
| 844 | PurpleStatus *now; | |
|
13989
9a647311c9ac
[gaim-migrate @ 16447]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13978
diff
changeset
|
845 | gboolean ascii = gnt_ascii_only(); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
846 | |
| 15884 | 847 | presence = purple_buddy_get_presence(buddy); |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
848 | if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
849 | strncpy(status, ascii ? ":" : "☎", sizeof(status) - 1); |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
850 | else { |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
851 | now = purple_presence_get_active_status(presence); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
852 | |
|
34855
9c289149eed4
Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents:
34849
diff
changeset
|
853 | prim = purple_status_type_get_primitive(purple_status_get_status_type(now)); |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
854 | |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
855 | switch(prim) { |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
856 | case PURPLE_STATUS_OFFLINE: |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
857 | strncpy(status, ascii ? "x" : "⊗", sizeof(status) - 1); |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
858 | break; |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
859 | case PURPLE_STATUS_AVAILABLE: |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
860 | strncpy(status, ascii ? "o" : "â—¯", sizeof(status) - 1); |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
861 | break; |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
862 | default: |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
863 | strncpy(status, ascii ? "." : "⊖", sizeof(status) - 1); |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
864 | break; |
|
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
865 | } |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
866 | } |
| 15884 | 867 | name = purple_buddy_get_alias(buddy); |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
868 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
869 | else if (PURPLE_IS_CHAT(node)) |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
870 | { |
| 15884 | 871 | PurpleChat *chat = (PurpleChat*)node; |
| 872 | name = purple_chat_get_name(chat); | |
|
13947
a77f6f615c20
[gaim-migrate @ 16365]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13946
diff
changeset
|
873 | |
|
a77f6f615c20
[gaim-migrate @ 16365]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13946
diff
changeset
|
874 | strncpy(status, "~", sizeof(status) - 1); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
875 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
876 | else if (PURPLE_IS_GROUP(node)) |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
877 | return purple_group_get_name((PurpleGroup*)node); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
878 | |
|
25708
7e97dbce8223
applied changes from aa7ce93329f5ccbe74640a92b6656ae402d8eea8
Ethan Blanton <elb@pidgin.im>
parents:
24799
diff
changeset
|
879 | g_snprintf(text, sizeof(text) - 1, "%s %s", status, name); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
880 | |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
881 | return text; |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
882 | } |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
883 | |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
884 | static void |
| 15884 | 885 | add_chat(PurpleChat *chat, FinchBlist *ggblist) |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
886 | { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
887 | gpointer parent; |
| 15884 | 888 | PurpleBlistNode *node = (PurpleBlistNode *)chat; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
889 | if (purple_blist_node_get_ui_data(node)) |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
890 | return; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
891 | if (!purple_account_is_connected(purple_chat_get_account(chat))) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
892 | return; |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
893 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
894 | parent = ggblist->manager->find_parent((PurpleBlistNode*)chat); |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
895 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
896 | create_finch_blist_node(node, gnt_tree_add_row_after(GNT_TREE(ggblist->tree), chat, |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14021
diff
changeset
|
897 | gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
898 | parent, NULL)); |
|
13946
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
899 | } |
|
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
900 | |
|
c895c1eeb4d7
[gaim-migrate @ 16364]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13939
diff
changeset
|
901 | static void |
| 15884 | 902 | add_contact(PurpleContact *contact, FinchBlist *ggblist) |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
903 | { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
904 | gpointer parent; |
| 15884 | 905 | PurpleBlistNode *node = (PurpleBlistNode*)contact; |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
906 | const char *name; |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
907 | |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
908 | if (purple_blist_node_get_ui_data(node)) |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
909 | return; |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
910 | |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
911 | name = get_display_name(node); |
|
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
912 | if (name == NULL) |
|
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
913 | return; |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
914 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
915 | parent = ggblist->manager->find_parent((PurpleBlistNode*)contact); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
916 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
917 | create_finch_blist_node(node, gnt_tree_add_row_after(GNT_TREE(ggblist->tree), contact, |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
918 | gnt_tree_create_row(GNT_TREE(ggblist->tree), name), |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
919 | parent, NULL)); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
920 | |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
921 | gnt_tree_set_expanded(GNT_TREE(ggblist->tree), contact, FALSE); |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
922 | } |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
923 | |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
924 | static void |
| 15884 | 925 | add_buddy(PurpleBuddy *buddy, FinchBlist *ggblist) |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
926 | { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
927 | gpointer parent; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
928 | PurpleBlistNode *node = (PurpleBlistNode *)buddy; |
| 15884 | 929 | PurpleContact *contact; |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
930 | |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
931 | if (purple_blist_node_get_ui_data(node)) |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
932 | return; |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
933 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
934 | contact = purple_buddy_get_contact(buddy); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
935 | parent = ggblist->manager->find_parent((PurpleBlistNode*)buddy); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
936 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
937 | create_finch_blist_node(node, gnt_tree_add_row_after(GNT_TREE(ggblist->tree), buddy, |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14021
diff
changeset
|
938 | gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
939 | parent, NULL)); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
940 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
941 | blist_update_row_flags((PurpleBlistNode*)buddy); |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
942 | if (buddy == purple_contact_get_priority_buddy(contact)) |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
943 | blist_update_row_flags((PurpleBlistNode*)contact); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
944 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
945 | |
| 15884 | 946 | PurpleBlistUiOps *finch_blist_get_ui_ops() |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
947 | { |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
948 | return &blist_ui_ops; |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
949 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
950 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
951 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
952 | selection_activate(GntWidget *widget, FinchBlist *ggblist) |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
953 | { |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
954 | GntTree *tree = GNT_TREE(ggblist->tree); |
| 15884 | 955 | PurpleBlistNode *node = gnt_tree_get_selection_data(tree); |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
956 | |
|
14005
198d1658b390
[gaim-migrate @ 16480]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13993
diff
changeset
|
957 | if (!node) |
|
198d1658b390
[gaim-migrate @ 16480]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13993
diff
changeset
|
958 | return; |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
959 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
960 | if (PURPLE_IS_CONTACT(node)) |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
961 | node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); |
|
14005
198d1658b390
[gaim-migrate @ 16480]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13993
diff
changeset
|
962 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
963 | if (PURPLE_IS_BUDDY(node)) |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
964 | { |
| 15884 | 965 | PurpleBuddy *buddy = (PurpleBuddy *)node; |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
966 | PurpleIMConversation *im; |
|
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
967 | im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), |
|
18134
47b947e1c8f1
present existing conversation window if one exists
Richard Nelson <wabz@pidgin.im>
parents:
18132
diff
changeset
|
968 | purple_buddy_get_account(buddy)); |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
969 | if (!im) { |
|
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
970 | im = purple_im_conversation_new(purple_buddy_get_account(buddy), |
|
18134
47b947e1c8f1
present existing conversation window if one exists
Richard Nelson <wabz@pidgin.im>
parents:
18132
diff
changeset
|
971 | purple_buddy_get_name(buddy)); |
|
47b947e1c8f1
present existing conversation window if one exists
Richard Nelson <wabz@pidgin.im>
parents:
18132
diff
changeset
|
972 | } else { |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
973 | FinchConv *ggconv = FINCH_CONV(PURPLE_CONVERSATION(im)); |
|
18134
47b947e1c8f1
present existing conversation window if one exists
Richard Nelson <wabz@pidgin.im>
parents:
18132
diff
changeset
|
974 | gnt_window_present(ggconv->window); |
|
47b947e1c8f1
present existing conversation window if one exists
Richard Nelson <wabz@pidgin.im>
parents:
18132
diff
changeset
|
975 | } |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
976 | finch_conversation_set_active(PURPLE_CONVERSATION(im)); |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
977 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
978 | else if (PURPLE_IS_CHAT(node)) |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
979 | { |
|
22986
a02bb7b14dca
Check to see if we are already in a room before attempting to join. If
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22976
diff
changeset
|
980 | join_chat((PurpleChat*)node); |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
981 | } |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
982 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
983 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
984 | static void |
| 15884 | 985 | append_proto_menu(GntMenu *menu, PurpleConnection *gc, PurpleBlistNode *node) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
986 | { |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
987 | GList *list; |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
988 | PurpleProtocol *protocol = purple_connection_get_protocol(gc); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
989 | |
|
36724
41150570364f
Refactored finch to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
990 | if(!protocol || !PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT_IFACE, blist_node_menu)) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
991 | return; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
992 | |
| 36719 | 993 | for(list = purple_protocol_client_iface_blist_node_menu(protocol, node); list; |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
994 | list = g_list_delete_link(list, list)) |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
995 | { |
| 15884 | 996 | PurpleMenuAction *act = (PurpleMenuAction *) list->data; |
|
30060
461d1acb4a54
Fix a crash caused by context menus for sametime buddies.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
30039
diff
changeset
|
997 | if (!act) |
|
461d1acb4a54
Fix a crash caused by context menus for sametime buddies.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
30039
diff
changeset
|
998 | continue; |
|
32287
c8cf9b704a49
Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32254
diff
changeset
|
999 | purple_menu_action_set_data(act, node); |
|
35494
e631108a5464
Fix namespace issues in libgnt and finch.
Ankit Vani <a@nevitus.org>
parents:
35475
diff
changeset
|
1000 | finch_append_menu_action(menu, act, node); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1001 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1002 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1003 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1004 | static void |
| 15884 | 1005 | add_custom_action(GntMenu *menu, const char *label, PurpleCallback callback, |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1006 | gpointer data) |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1007 | { |
| 15884 | 1008 | PurpleMenuAction *action = purple_menu_action_new(label, callback, data, NULL); |
|
35494
e631108a5464
Fix namespace issues in libgnt and finch.
Ankit Vani <a@nevitus.org>
parents:
35475
diff
changeset
|
1009 | finch_append_menu_action(menu, action, NULL); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1010 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1011 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1012 | static void |
| 15884 | 1013 | chat_components_edit_ok(PurpleChat *chat, PurpleRequestFields *allfields) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1014 | { |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1015 | GList *groups, *fields; |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1016 | |
| 15884 | 1017 | for (groups = purple_request_fields_get_groups(allfields); groups; groups = groups->next) { |
| 1018 | fields = purple_request_field_group_get_fields(groups->data); | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1019 | for (; fields; fields = fields->next) { |
| 15884 | 1020 | PurpleRequestField *field = fields->data; |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1021 | const char *id; |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1022 | char *val; |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1023 | |
| 15884 | 1024 | id = purple_request_field_get_id(field); |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
1025 | if (purple_request_field_get_field_type(field) == PURPLE_REQUEST_FIELD_INTEGER) |
| 15884 | 1026 | val = g_strdup_printf("%d", purple_request_field_int_get_value(field)); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1027 | else |
| 15884 | 1028 | val = g_strdup(purple_request_field_string_get_value(field)); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1029 | |
|
22935
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1030 | if (!val) { |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1031 | g_hash_table_remove(purple_chat_get_components(chat), id); |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1032 | } else { |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1033 | g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val); /* val should not be free'd */ |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1034 | } |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1035 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1036 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1037 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1038 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1039 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1040 | chat_components_edit(PurpleBlistNode *selected, PurpleChat *chat) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1041 | { |
| 15884 | 1042 | PurpleRequestFields *fields = purple_request_fields_new(); |
| 1043 | PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); | |
| 1044 | PurpleRequestField *field; | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1045 | GList *parts, *iter; |
|
36555
fc17a4351e63
Replaced struct proto_chat_entry with PurpleProtocolChatEntry
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
1046 | PurpleProtocolChatEntry *pce; |
|
22335
f6715418a9a8
Update finch to not touch the internals of PurpleAccount. This also includes a change I made to reduce the Cyclomatic Complexity of one of the functions.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22334
diff
changeset
|
1047 | PurpleConnection *gc; |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1048 | |
| 15884 | 1049 | purple_request_fields_add_group(fields, group); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1050 | |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1051 | gc = purple_account_get_connection(purple_chat_get_account(chat)); |
| 36719 | 1052 | parts = purple_protocol_chat_iface_info(purple_connection_get_protocol(gc), gc); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1053 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1054 | for (iter = parts; iter; iter = iter->next) { |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1055 | pce = iter->data; |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1056 | if (pce->is_int) { |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1057 | int val; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1058 | const char *str = g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1059 | if (!str || sscanf(str, "%d", &val) != 1) |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1060 | val = pce->min; |
|
33935
e740bbb8350c
Request API: fix integer fields, add bounds to them
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32849
diff
changeset
|
1061 | field = purple_request_field_int_new(pce->identifier, pce->label, val, INT_MIN, INT_MAX); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1062 | } else { |
| 15884 | 1063 | field = purple_request_field_string_new(pce->identifier, pce->label, |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1064 | g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE); |
|
22935
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1065 | if (pce->secret) |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1066 | purple_request_field_string_set_masked(field, TRUE); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1067 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1068 | |
|
22935
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1069 | if (pce->required) |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1070 | purple_request_field_set_required(field, TRUE); |
|
80562b52fb71
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22579
diff
changeset
|
1071 | |
| 15884 | 1072 | purple_request_field_group_add_field(group, field); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1073 | g_free(pce); |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1074 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1075 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1076 | g_list_free(parts); |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1077 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1078 | purple_request_fields(NULL, _("Edit Chat"), NULL, _("Please Update the necessary fields."), |
|
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:
16478
diff
changeset
|
1079 | fields, _("Edit"), G_CALLBACK(chat_components_edit_ok), _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
1080 | NULL, chat); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1081 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1082 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1083 | static void |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1084 | autojoin_toggled(GntMenuItem *item, gpointer data) |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1085 | { |
| 15884 | 1086 | PurpleMenuAction *action = data; |
|
32287
c8cf9b704a49
Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32254
diff
changeset
|
1087 | purple_blist_node_set_bool(purple_menu_action_get_data(action), "gnt-autojoin", |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
1088 | gnt_menuitem_check_get_checked(GNT_MENU_ITEM_CHECK(item))); |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1089 | } |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1090 | |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1091 | static void |
| 15884 | 1092 | create_chat_menu(GntMenu *menu, PurpleChat *chat) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1093 | { |
| 15884 | 1094 | PurpleMenuAction *action = purple_menu_action_new(_("Auto-join"), NULL, chat, NULL); |
|
32287
c8cf9b704a49
Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32254
diff
changeset
|
1095 | GntMenuItem *check = gnt_menuitem_check_new( |
|
c8cf9b704a49
Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
32254
diff
changeset
|
1096 | purple_menu_action_get_label(action)); |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
1097 | gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(check), |
| 15884 | 1098 | purple_blist_node_get_bool((PurpleBlistNode*)chat, "gnt-autojoin")); |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1099 | gnt_menu_add_item(menu, check); |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1100 | gnt_menuitem_set_callback(check, autojoin_toggled, action); |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1101 | g_signal_connect_swapped(G_OBJECT(menu), "destroy", |
| 15884 | 1102 | G_CALLBACK(purple_menu_action_free), action); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1103 | |
|
38651
966bb404064f
finch: add protocol menu to blist chats
Dylan Simon <dylan@dylex.net>
parents:
38433
diff
changeset
|
1104 | /* Protocol actions */ |
|
966bb404064f
finch: add protocol menu to blist chats
Dylan Simon <dylan@dylex.net>
parents:
38433
diff
changeset
|
1105 | append_proto_menu(menu, |
|
966bb404064f
finch: add protocol menu to blist chats
Dylan Simon <dylan@dylex.net>
parents:
38433
diff
changeset
|
1106 | purple_account_get_connection(purple_chat_get_account(chat)), |
|
966bb404064f
finch: add protocol menu to blist chats
Dylan Simon <dylan@dylex.net>
parents:
38433
diff
changeset
|
1107 | (PurpleBlistNode*)chat); |
|
966bb404064f
finch: add protocol menu to blist chats
Dylan Simon <dylan@dylex.net>
parents:
38433
diff
changeset
|
1108 | |
| 15884 | 1109 | add_custom_action(menu, _("Edit Settings"), (PurpleCallback)chat_components_edit, chat); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1110 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1111 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1112 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1113 | finch_add_buddy(PurpleBlistNode *selected, PurpleGroup *grp) |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1114 | { |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
1115 | purple_blist_request_add_buddy(NULL, NULL, grp ? purple_group_get_name(grp) : NULL, NULL); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1116 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1117 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1118 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1119 | finch_add_group(PurpleBlistNode *selected, PurpleGroup *grp) |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1120 | { |
| 15884 | 1121 | purple_blist_request_add_group(); |
|
14124
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1122 | } |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1123 | |
|
181ebb961493
[gaim-migrate @ 16681]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14121
diff
changeset
|
1124 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1125 | finch_add_chat(PurpleBlistNode *selected, PurpleGroup *grp) |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1126 | { |
| 15884 | 1127 | purple_blist_request_add_chat(NULL, grp, NULL, NULL); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1128 | } |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1129 | |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1130 | static void |
| 15884 | 1131 | create_group_menu(GntMenu *menu, PurpleGroup *group) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1132 | { |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1133 | add_custom_action(menu, _("Add Buddy"), |
| 15884 | 1134 | PURPLE_CALLBACK(finch_add_buddy), group); |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1135 | add_custom_action(menu, _("Add Chat"), |
| 15884 | 1136 | PURPLE_CALLBACK(finch_add_chat), group); |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1137 | add_custom_action(menu, _("Add Group"), |
| 15884 | 1138 | PURPLE_CALLBACK(finch_add_group), group); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1139 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1140 | |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17366
diff
changeset
|
1141 | gpointer finch_retrieve_user_info(PurpleConnection *conn, const char *name) |
|
17360
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1142 | { |
|
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1143 | PurpleNotifyUserInfo *info = purple_notify_user_info_new(); |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17366
diff
changeset
|
1144 | gpointer uihandle; |
|
32188
cb9cad610bc6
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents:
31601
diff
changeset
|
1145 | purple_notify_user_info_add_pair_plaintext(info, _("Information"), _("Retrieving...")); |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17366
diff
changeset
|
1146 | uihandle = purple_notify_userinfo(conn, name, info, NULL, NULL); |
|
17360
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1147 | purple_notify_user_info_destroy(info); |
|
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1148 | |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
1149 | purple_serv_get_info(conn, name); |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17366
diff
changeset
|
1150 | return uihandle; |
|
17360
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1151 | } |
|
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17295
diff
changeset
|
1152 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1153 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1154 | finch_blist_get_buddy_info_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1155 | { |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1156 | finch_retrieve_user_info(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy)); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1157 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1158 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1159 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1160 | finch_blist_menu_send_file_cb(PurpleBlistNode *selected, PurpleBuddy *buddy) |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1161 | { |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
1162 | purple_serv_send_file(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy), NULL); |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1163 | } |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1164 | |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1165 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1166 | finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node) |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1167 | { |
| 15884 | 1168 | PurpleBuddy *b; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1169 | if (PURPLE_IS_CONTACT(node)) |
| 15884 | 1170 | b = purple_contact_get_priority_buddy((PurpleContact *)node); |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1171 | else |
| 15884 | 1172 | b = (PurpleBuddy *)node; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1173 | finch_pounce_editor_show(purple_buddy_get_account(b), purple_buddy_get_name(b), NULL); |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1174 | } |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1175 | |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1176 | static void |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1177 | toggle_block_buddy(GntMenuItem *item, gpointer buddy) |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1178 | { |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1179 | gboolean block = gnt_menuitem_check_get_checked(GNT_MENU_ITEM_CHECK(item)); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1180 | PurpleAccount *account = purple_buddy_get_account(buddy); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1181 | const char *name = purple_buddy_get_name(buddy); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1182 | |
|
34584
ed2747e0598c
Refactored finch to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33935
diff
changeset
|
1183 | block ? purple_account_privacy_deny(account, name) : |
|
ed2747e0598c
Refactored finch to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33935
diff
changeset
|
1184 | purple_account_privacy_allow(account, name); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1185 | } |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1186 | |
|
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1187 | static void |
|
24504
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1188 | toggle_show_offline(GntMenuItem *item, gpointer buddy) |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1189 | { |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1190 | purple_blist_node_set_bool(buddy, "show_offline", |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1191 | !purple_blist_node_get_bool(buddy, "show_offline")); |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1192 | if (!ggblist->manager->can_add_node(buddy)) |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
1193 | node_remove(purple_blist_get_buddy_list(), buddy); |
|
24504
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1194 | else |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
1195 | node_update(purple_blist_get_buddy_list(), buddy); |
|
24504
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1196 | } |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1197 | |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1198 | static void |
| 15884 | 1199 | create_buddy_menu(GntMenu *menu, PurpleBuddy *buddy) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1200 | { |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1201 | PurpleAccount *account; |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1202 | gboolean permitted; |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1203 | GntMenuItem *item; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
1204 | PurpleProtocol *protocol; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1205 | PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); |
|
22335
f6715418a9a8
Update finch to not touch the internals of PurpleAccount. This also includes a change I made to reduce the Cyclomatic Complexity of one of the functions.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22334
diff
changeset
|
1206 | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
1207 | protocol = purple_connection_get_protocol(gc); |
|
36724
41150570364f
Refactored finch to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1208 | if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, get_info)) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1209 | { |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1210 | add_custom_action(menu, _("Get Info"), |
| 15884 | 1211 | PURPLE_CALLBACK(finch_blist_get_buddy_info_cb), buddy); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1212 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1213 | |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1214 | add_custom_action(menu, _("Add Buddy Pounce"), |
| 15884 | 1215 | PURPLE_CALLBACK(finch_blist_pounce_node_cb), buddy); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1216 | |
|
38827
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1217 | if (PURPLE_IS_PROTOCOL_XFER(protocol)) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1218 | { |
|
38827
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1219 | if (purple_protocol_xfer_can_receive( |
|
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1220 | PURPLE_PROTOCOL_XFER(protocol), |
|
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1221 | gc, |
|
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1222 | purple_buddy_get_name(buddy)) |
|
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1223 | ) { |
|
15702
111fdd9108cc
Patch from Richard 'wabz' Nelson to add file-transfer ui. Amazing stuff\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15564
diff
changeset
|
1224 | add_custom_action(menu, _("Send File"), |
| 15884 | 1225 | PURPLE_CALLBACK(finch_blist_menu_send_file_cb), buddy); |
|
38827
3573c82d32d8
Initial attempt at removing the magic around PurpleProtocolXferInterface
Gary Kramlich <grim@reaperworld.com>
parents:
38433
diff
changeset
|
1226 | } |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1227 | } |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1228 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1229 | account = purple_buddy_get_account(buddy); |
|
34584
ed2747e0598c
Refactored finch to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33935
diff
changeset
|
1230 | permitted = purple_account_privacy_check(account, purple_buddy_get_name(buddy)); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1231 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1232 | item = gnt_menuitem_check_new(_("Blocked")); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1233 | gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), !permitted); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1234 | gnt_menuitem_set_callback(item, toggle_block_buddy, buddy); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1235 | gnt_menu_add_item(menu, item); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
1236 | |
|
24504
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1237 | item = gnt_menuitem_check_new(_("Show when offline")); |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1238 | gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline")); |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1239 | gnt_menuitem_set_callback(item, toggle_show_offline, buddy); |
|
7cc4ea958ea8
Show when offline (because the plugin doesn't work no more).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24458
diff
changeset
|
1240 | gnt_menu_add_item(menu, item); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1241 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1242 | /* Protocol actions */ |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1243 | append_proto_menu(menu, |
| 15884 | 1244 | purple_account_get_connection(purple_buddy_get_account(buddy)), |
| 1245 | (PurpleBlistNode*)buddy); | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1246 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1247 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1248 | static void |
| 15884 | 1249 | append_extended_menu(GntMenu *menu, PurpleBlistNode *node) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1250 | { |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1251 | GList *iter; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1252 | |
| 15884 | 1253 | for (iter = purple_blist_node_get_extended_menu(node); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1254 | iter; iter = g_list_delete_link(iter, iter)) |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1255 | { |
|
35494
e631108a5464
Fix namespace issues in libgnt and finch.
Ankit Vani <a@nevitus.org>
parents:
35475
diff
changeset
|
1256 | finch_append_menu_action(menu, iter->data, node); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1257 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1258 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1259 | |
| 15884 | 1260 | /* Xerox'd from gtkdialogs.c:purple_gtkdialogs_remove_contact_cb */ |
| 14756 | 1261 | static void |
| 15884 | 1262 | remove_contact(PurpleContact *contact) |
| 14756 | 1263 | { |
| 15884 | 1264 | PurpleBlistNode *bnode, *cnode; |
| 1265 | PurpleGroup *group; | |
| 14756 | 1266 | |
| 15884 | 1267 | cnode = (PurpleBlistNode *)contact; |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1268 | group = (PurpleGroup*)purple_blist_node_get_parent(cnode); |
|
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1269 | for (bnode = purple_blist_node_get_first_child(cnode); bnode; bnode = purple_blist_node_get_sibling_next(bnode)) { |
| 15884 | 1270 | PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1271 | PurpleAccount *account = purple_buddy_get_account(buddy); |
|
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1272 | if (purple_account_is_connected(account)) |
|
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1273 | purple_account_remove_buddy(account, buddy, group); |
| 14756 | 1274 | } |
| 15884 | 1275 | purple_blist_remove_contact(contact); |
| 14756 | 1276 | } |
| 1277 | ||
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1278 | static void |
| 15884 | 1279 | rename_blist_node(PurpleBlistNode *node, const char *newname) |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1280 | { |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1281 | const char *name = newname; |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1282 | if (name && !*name) |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1283 | name = NULL; |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1284 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1285 | if (PURPLE_IS_CONTACT(node)) { |
| 15884 | 1286 | PurpleContact *contact = (PurpleContact*)node; |
| 1287 | PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
1288 | purple_contact_set_alias(contact, name); |
|
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
1289 | purple_buddy_set_local_alias(buddy, name); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
1290 | purple_serv_alias_buddy(buddy); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1291 | } else if (PURPLE_IS_BUDDY(node)) { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
1292 | purple_buddy_set_local_alias((PurpleBuddy*)node, name); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
1293 | purple_serv_alias_buddy((PurpleBuddy*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1294 | } else if (PURPLE_IS_CHAT(node)) |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
1295 | purple_chat_set_alias((PurpleChat*)node, name); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1296 | else if (PURPLE_IS_GROUP(node) && (name != NULL)) |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
1297 | purple_group_set_name((PurpleGroup*)node, name); |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1298 | else |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1299 | g_return_if_reached(); |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1300 | } |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1301 | |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1302 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1303 | finch_blist_rename_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1304 | { |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1305 | const char *name = NULL; |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1306 | char *prompt; |
|
16344
4f2b448b7559
Use 'alias' instead of 'rename' for non-group nodes. Thankfully, this does not introduce new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
1307 | const char *text; |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1308 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1309 | if (PURPLE_IS_CONTACT(node)) |
| 15884 | 1310 | name = purple_contact_get_alias((PurpleContact*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1311 | else if (PURPLE_IS_BUDDY(node)) |
| 15884 | 1312 | name = purple_buddy_get_contact_alias((PurpleBuddy*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1313 | else if (PURPLE_IS_CHAT(node)) |
| 15884 | 1314 | name = purple_chat_get_name((PurpleChat*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1315 | else if (PURPLE_IS_GROUP(node)) |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
1316 | name = purple_group_get_name((PurpleGroup*)node); |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1317 | else |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1318 | g_return_if_reached(); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1319 | |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1320 | prompt = g_strdup_printf(_("Please enter the new name for %s"), name); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1321 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1322 | text = PURPLE_IS_GROUP(node) ? _("Rename") : _("Set Alias"); |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1323 | purple_request_input(node, text, prompt, _("Enter empty string to reset the name."), |
|
16344
4f2b448b7559
Use 'alias' instead of 'rename' for non-group nodes. Thankfully, this does not introduce new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
1324 | name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node), |
|
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:
16478
diff
changeset
|
1325 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33935
diff
changeset
|
1326 | NULL, node); |
|
14080
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1327 | |
|
7fad848bbe7b
[gaim-migrate @ 16614]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14072
diff
changeset
|
1328 | g_free(prompt); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1329 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1330 | |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1331 | |
|
22491
06d2ee82aa58
Fix showing a contact's log, and don't access struct internals
Richard Nelson <wabz@pidgin.im>
parents:
22431
diff
changeset
|
1332 | static void showlog_cb(PurpleBlistNode *sel, PurpleBlistNode *node) |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1333 | { |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1334 | PurpleLogType type; |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1335 | PurpleAccount *account; |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1336 | char *name = NULL; |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1337 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1338 | if (PURPLE_IS_BUDDY(node)) { |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1339 | PurpleBuddy *b = (PurpleBuddy*) node; |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1340 | type = PURPLE_LOG_IM; |
|
24951
d0837696fd3a
Struct hiding for Finch. PurpleChat:alias and PurpleContact:totalsize are still used.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
1341 | name = g_strdup(purple_buddy_get_name(b)); |
|
d0837696fd3a
Struct hiding for Finch. PurpleChat:alias and PurpleContact:totalsize are still used.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
1342 | account = purple_buddy_get_account(b); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1343 | } else if (PURPLE_IS_CHAT(node)) { |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1344 | PurpleChat *c = (PurpleChat*) node; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
1345 | PurpleProtocol *protocol = NULL; |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1346 | type = PURPLE_LOG_CHAT; |
|
24951
d0837696fd3a
Struct hiding for Finch. PurpleChat:alias and PurpleContact:totalsize are still used.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
1347 | account = purple_chat_get_account(c); |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36623
diff
changeset
|
1348 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
36632
1f0650e7b1b5
Refactored finch and a bit of libpurple plugins to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1349 | if (protocol) { |
| 36719 | 1350 | name = purple_protocol_chat_iface_get_name(protocol, purple_chat_get_components(c)); |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1351 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1352 | } else if (PURPLE_IS_CONTACT(node)) { |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1353 | finch_log_show_contact((PurpleContact *)node); |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1354 | return; |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1355 | } else { |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1356 | /* This callback should not have been registered for a node |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1357 | * that doesn't match the type of one of the blocks above. */ |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1358 | g_return_if_reached(); |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1359 | } |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1360 | |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1361 | if (name && account) { |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1362 | finch_log_show(type, name, account); |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1363 | g_free(name); |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1364 | } |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1365 | } |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1366 | |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1367 | |
| 15884 | 1368 | /* Xeroxed from gtkdialogs.c:purple_gtkdialogs_remove_group_cb*/ |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1369 | static void |
| 15884 | 1370 | remove_group(PurpleGroup *group) |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1371 | { |
| 15884 | 1372 | PurpleBlistNode *cnode, *bnode; |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1373 | |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1374 | cnode = purple_blist_node_get_first_child(((PurpleBlistNode*)group)); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1375 | |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1376 | while (cnode) { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1377 | if (PURPLE_IS_CONTACT(cnode)) { |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1378 | bnode = purple_blist_node_get_first_child(cnode); |
|
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1379 | cnode = purple_blist_node_get_sibling_next(cnode); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1380 | while (bnode) { |
| 15884 | 1381 | PurpleBuddy *buddy; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1382 | if (PURPLE_IS_BUDDY(bnode)) { |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1383 | PurpleAccount *account; |
| 15884 | 1384 | buddy = (PurpleBuddy*)bnode; |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1385 | bnode = purple_blist_node_get_sibling_next(bnode); |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1386 | account = purple_buddy_get_account(buddy); |
|
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1387 | if (purple_account_is_connected(account)) { |
|
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1388 | purple_account_remove_buddy(account, buddy, group); |
| 15884 | 1389 | purple_blist_remove_buddy(buddy); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1390 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1391 | } else { |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1392 | bnode = purple_blist_node_get_sibling_next(bnode); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1393 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1394 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1395 | } else if (PURPLE_IS_CHAT(cnode)) { |
| 15884 | 1396 | PurpleChat *chat = (PurpleChat *)cnode; |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1397 | cnode = purple_blist_node_get_sibling_next(cnode); |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
1398 | if (purple_account_is_connected(purple_chat_get_account(chat))) |
| 15884 | 1399 | purple_blist_remove_chat(chat); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1400 | } else { |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1401 | cnode = purple_blist_node_get_sibling_next(cnode); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1402 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1403 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1404 | |
| 15884 | 1405 | purple_blist_remove_group(group); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1406 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1407 | |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1408 | static void |
| 15884 | 1409 | finch_blist_remove_node(PurpleBlistNode *node) |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1410 | { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1411 | if (PURPLE_IS_CONTACT(node)) { |
| 15884 | 1412 | remove_contact((PurpleContact*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1413 | } else if (PURPLE_IS_BUDDY(node)) { |
| 15884 | 1414 | PurpleBuddy *buddy = (PurpleBuddy*)node; |
| 1415 | PurpleGroup *group = purple_buddy_get_group(buddy); | |
| 1416 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); | |
| 1417 | purple_blist_remove_buddy(buddy); | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1418 | } else if (PURPLE_IS_CHAT(node)) { |
| 15884 | 1419 | purple_blist_remove_chat((PurpleChat*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1420 | } else if (PURPLE_IS_GROUP(node)) { |
| 15884 | 1421 | remove_group((PurpleGroup*)node); |
|
14125
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1422 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1423 | } |
|
2a14281b124b
[gaim-migrate @ 16682]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14124
diff
changeset
|
1424 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1425 | static void |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1426 | finch_blist_remove_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1427 | { |
|
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:
16478
diff
changeset
|
1428 | PurpleAccount *account = NULL; |
|
14260
a21577fbb4d2
[gaim-migrate @ 16870]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14194
diff
changeset
|
1429 | char *primary; |
|
a21577fbb4d2
[gaim-migrate @ 16870]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14194
diff
changeset
|
1430 | const char *name, *sec = NULL; |
|
14126
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1431 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1432 | if (PURPLE_IS_CONTACT(node)) { |
| 15884 | 1433 | PurpleContact *c = (PurpleContact*)node; |
| 1434 | name = purple_contact_get_alias(c); | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
1435 | if (purple_counting_node_get_total_size(PURPLE_COUNTING_NODE(c)) > 1) |
| 14756 | 1436 | sec = _("Removing this contact will also remove all the buddies in the contact"); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1437 | } else if (PURPLE_IS_BUDDY(node)) { |
| 15884 | 1438 | name = purple_buddy_get_name((PurpleBuddy*)node); |
|
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:
16478
diff
changeset
|
1439 | account = purple_buddy_get_account((PurpleBuddy*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1440 | } else if (PURPLE_IS_CHAT(node)) { |
| 15884 | 1441 | name = purple_chat_get_name((PurpleChat*)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1442 | } else if (PURPLE_IS_GROUP(node)) { |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
1443 | name = purple_group_get_name((PurpleGroup*)node); |
|
14126
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1444 | sec = _("Removing this group will also remove all the buddies in the group"); |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1445 | } |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1446 | else |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1447 | return; |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1448 | |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1449 | primary = g_strdup_printf(_("Are you sure you want to remove %s?"), name); |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1450 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1451 | /* XXX: anything to do with the returned ui-handle? */ |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1452 | purple_request_action(node, _("Confirm Remove"), |
|
14126
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1453 | primary, sec, |
|
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:
16478
diff
changeset
|
1454 | 1, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
1455 | purple_request_cpar_from_account(account), |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1456 | node, 2, |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1457 | _("Remove"), finch_blist_remove_node, |
|
14126
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1458 | _("Cancel"), NULL); |
|
176d35315165
[gaim-migrate @ 16683]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14125
diff
changeset
|
1459 | g_free(primary); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1460 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1461 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1462 | static void |
| 15884 | 1463 | finch_blist_toggle_tag_buddy(PurpleBlistNode *node) |
| 14756 | 1464 | { |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1465 | GList *iter; |
|
15377
f45f57e922a7
[gaim-migrate @ 18106]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15244
diff
changeset
|
1466 | if (node == NULL) |
|
f45f57e922a7
[gaim-migrate @ 18106]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15244
diff
changeset
|
1467 | return; |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1468 | if (ggblist->tagged && (iter = g_list_find(ggblist->tagged, node)) != NULL) { |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1469 | ggblist->tagged = g_list_delete_link(ggblist->tagged, iter); |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1470 | } else { |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1471 | ggblist->tagged = g_list_prepend(ggblist->tagged, node); |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1472 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1473 | if (PURPLE_IS_CONTACT(node)) |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
1474 | update_buddy_display(purple_contact_get_priority_buddy(PURPLE_CONTACT(node)), ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1475 | else if (PURPLE_IS_BUDDY(node)) |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1476 | update_buddy_display((PurpleBuddy*)node, ggblist); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1477 | else |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1478 | update_node_display(node, ggblist); |
| 14756 | 1479 | } |
| 1480 | ||
| 1481 | static void | |
| 15884 | 1482 | finch_blist_place_tagged(PurpleBlistNode *target) |
| 14756 | 1483 | { |
| 15884 | 1484 | PurpleGroup *tg = NULL; |
| 1485 | PurpleContact *tc = NULL; | |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1486 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
1487 | if (target == NULL || !(PURPLE_IS_BUDDY(target) || PURPLE_IS_CONTACT(target) || |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
1488 | PURPLE_IS_GROUP(target) || PURPLE_IS_CHAT(target))) |
|
15377
f45f57e922a7
[gaim-migrate @ 18106]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15244
diff
changeset
|
1489 | return; |
|
f45f57e922a7
[gaim-migrate @ 18106]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15244
diff
changeset
|
1490 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1491 | if (PURPLE_IS_GROUP(target)) |
| 15884 | 1492 | tg = (PurpleGroup*)target; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1493 | else if (PURPLE_IS_BUDDY(target)) { |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1494 | tc = (PurpleContact*)purple_blist_node_get_parent(target); |
|
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1495 | tg = (PurpleGroup*)purple_blist_node_get_parent((PurpleBlistNode*)tc); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1496 | } else { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1497 | if (PURPLE_IS_CONTACT(target)) |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1498 | tc = (PurpleContact*)target; |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1499 | tg = (PurpleGroup*)purple_blist_node_get_parent(target); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1500 | } |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1501 | |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1502 | if (ggblist->tagged) { |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1503 | GList *list = ggblist->tagged; |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1504 | ggblist->tagged = NULL; |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1505 | while (list) { |
| 15884 | 1506 | PurpleBlistNode *node = list->data; |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1507 | list = g_list_delete_link(list, list); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1508 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1509 | if (PURPLE_IS_GROUP(node)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1510 | update_node_display(node, ggblist); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1511 | /* Add the group after the current group */ |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1512 | purple_blist_add_group((PurpleGroup*)node, (PurpleBlistNode*)tg); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1513 | } else if (PURPLE_IS_CONTACT(node)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1514 | update_buddy_display(purple_contact_get_priority_buddy((PurpleContact*)node), ggblist); |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
1515 | if (PURPLE_BLIST_NODE(tg) == target) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1516 | /* The target is a group, just add the contact to the group. */ |
| 15884 | 1517 | purple_blist_add_contact((PurpleContact*)node, tg, NULL); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1518 | } else if (tc) { |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1519 | /* The target is either a buddy, or a contact. Merge with that contact. */ |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34855
diff
changeset
|
1520 | purple_contact_merge((PurpleContact*)node, (PurpleBlistNode*)tc); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1521 | } else { |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1522 | /* The target is a chat. Add the contact to the group after this chat. */ |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1523 | purple_blist_add_contact((PurpleContact*)node, NULL, target); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1524 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1525 | } else if (PURPLE_IS_BUDDY(node)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1526 | update_buddy_display((PurpleBuddy*)node, ggblist); |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
1527 | if (PURPLE_BLIST_NODE(tg) == target) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1528 | /* The target is a group. Add this buddy in a new contact under this group. */ |
| 15884 | 1529 | purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1530 | } else if (PURPLE_IS_CONTACT(target)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1531 | /* Add to the contact. */ |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1532 | purple_blist_add_buddy((PurpleBuddy*)node, tc, NULL, NULL); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1533 | } else if (PURPLE_IS_BUDDY(target)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1534 | /* Add to the contact after the selected buddy. */ |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1535 | purple_blist_add_buddy((PurpleBuddy*)node, NULL, NULL, target); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1536 | } else if (PURPLE_IS_CHAT(target)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1537 | /* Add to the selected chat's group. */ |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1538 | purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1539 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1540 | } else if (PURPLE_IS_CHAT(node)) { |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1541 | update_node_display(node, ggblist); |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
1542 | if (PURPLE_BLIST_NODE(tg) == target) |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1543 | purple_blist_add_chat((PurpleChat*)node, tg, NULL); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1544 | else |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1545 | purple_blist_add_chat((PurpleChat*)node, NULL, target); |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1546 | } |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1547 | } |
| 14756 | 1548 | } |
| 1549 | } | |
| 1550 | ||
| 1551 | static void | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1552 | context_menu_destroyed(GntWidget *widget, FinchBlist *ggblist) |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1553 | { |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1554 | ggblist->context = NULL; |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1555 | } |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1556 | |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1557 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1558 | draw_context_menu(FinchBlist *ggblist) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1559 | { |
| 15884 | 1560 | PurpleBlistNode *node = NULL; |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1561 | GntWidget *context = NULL; |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1562 | GntTree *tree = NULL; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1563 | int x, y, top, width; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1564 | char *title = NULL; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1565 | |
|
16869
f35dce8e5bc3
Do not build the context menu if one is already being shown.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16837
diff
changeset
|
1566 | if (ggblist->context) |
|
f35dce8e5bc3
Do not build the context menu if one is already being shown.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16837
diff
changeset
|
1567 | return; |
|
f35dce8e5bc3
Do not build the context menu if one is already being shown.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16837
diff
changeset
|
1568 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1569 | tree = GNT_TREE(ggblist->tree); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1570 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1571 | node = gnt_tree_get_selection_data(tree); |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
1572 | if (node && !(PURPLE_IS_BUDDY(node) || PURPLE_IS_CONTACT(node) || |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
1573 | PURPLE_IS_GROUP(node) || PURPLE_IS_CHAT(node))) |
|
22286
c97b158bd4f4
Do not show a context menu for an unknown node.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22285
diff
changeset
|
1574 | return; |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1575 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1576 | if (ggblist->tooltip) |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1577 | remove_tooltip(ggblist); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1578 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1579 | ggblist->cnode = node; |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1580 | |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1581 | ggblist->context = context = gnt_menu_new(GNT_MENU_POPUP); |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1582 | g_signal_connect(G_OBJECT(context), "destroy", G_CALLBACK(context_menu_destroyed), ggblist); |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1583 | g_signal_connect(G_OBJECT(context), "hide", G_CALLBACK(gnt_widget_destroy), NULL); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1584 | |
| 14756 | 1585 | if (!node) { |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1586 | create_group_menu(GNT_MENU(context), NULL); |
| 14756 | 1587 | title = g_strdup(_("Buddy List")); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1588 | } else if (PURPLE_IS_CONTACT(node)) { |
|
24974
a81952e9babb
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@pidgin.im>
parents:
24951
diff
changeset
|
1589 | ggblist->cnode = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node))); |
|
18831
ed4592c036ec
Fix a crash Eric found. These parameters were in reverse order.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18787
diff
changeset
|
1590 | create_buddy_menu(GNT_MENU(context), (PurpleBuddy*)ggblist->cnode); |
| 15884 | 1591 | title = g_strdup(purple_contact_get_alias((PurpleContact*)node)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1592 | } else if (PURPLE_IS_BUDDY(node)) { |
| 15884 | 1593 | PurpleBuddy *buddy = (PurpleBuddy *)node; |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1594 | create_buddy_menu(GNT_MENU(context), buddy); |
| 15884 | 1595 | title = g_strdup(purple_buddy_get_name(buddy)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1596 | } else if (PURPLE_IS_CHAT(node)) { |
| 15884 | 1597 | PurpleChat *chat = (PurpleChat*)node; |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1598 | create_chat_menu(GNT_MENU(context), chat); |
| 15884 | 1599 | title = g_strdup(purple_chat_get_name(chat)); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1600 | } else if (PURPLE_IS_GROUP(node)) { |
| 15884 | 1601 | PurpleGroup *group = (PurpleGroup *)node; |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1602 | create_group_menu(GNT_MENU(context), group); |
|
22342
916c989bd2c0
Update finch to not touch the internals of PurpleGroup.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22341
diff
changeset
|
1603 | title = g_strdup(purple_group_get_name(group)); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1604 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1605 | |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1606 | append_extended_menu(GNT_MENU(context), node); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1607 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1608 | /* These are common for everything */ |
| 14756 | 1609 | if (node) { |
|
16344
4f2b448b7559
Use 'alias' instead of 'rename' for non-group nodes. Thankfully, this does not introduce new strings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
1610 | add_custom_action(GNT_MENU(context), |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1611 | PURPLE_IS_GROUP(node) ? _("Rename") : _("Alias"), |
| 15884 | 1612 | PURPLE_CALLBACK(finch_blist_rename_node_cb), node); |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1613 | add_custom_action(GNT_MENU(context), _("Remove"), |
| 15884 | 1614 | PURPLE_CALLBACK(finch_blist_remove_node_cb), node); |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1615 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1616 | if (ggblist->tagged && (PURPLE_IS_CONTACT(node) |
|
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1617 | || PURPLE_IS_GROUP(node))) { |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1618 | add_custom_action(GNT_MENU(context), _("Place tagged"), |
| 15884 | 1619 | PURPLE_CALLBACK(finch_blist_place_tagged), node); |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1620 | } |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
1621 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1622 | if (PURPLE_IS_BUDDY(node) || PURPLE_IS_CONTACT(node)) { |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1623 | add_custom_action(GNT_MENU(context), _("Toggle Tag"), |
| 15884 | 1624 | PURPLE_CALLBACK(finch_blist_toggle_tag_buddy), node); |
| 14756 | 1625 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1626 | if (!PURPLE_IS_GROUP(node)) { |
|
22376
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1627 | add_custom_action(GNT_MENU(context), _("View Log"), |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1628 | PURPLE_CALLBACK(showlog_cb), node); |
|
25a17b6b69c2
Add a finch log viewer. This is largely copied from Pidgin.
Richard Nelson <wabz@pidgin.im>
parents:
22342
diff
changeset
|
1629 | } |
| 14756 | 1630 | } |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1631 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1632 | /* Set the position for the popup */ |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1633 | gnt_widget_get_position(GNT_WIDGET(tree), &x, &y); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1634 | gnt_widget_get_size(GNT_WIDGET(tree), &width, NULL); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1635 | top = gnt_tree_get_selection_visible_line(tree); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1636 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1637 | x += width; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1638 | y += top - 1; |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1639 | |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1640 | gnt_widget_set_position(context, x, y); |
|
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1641 | gnt_screen_menu_show(GNT_MENU(context)); |
|
14021
a633de85f90e
[gaim-migrate @ 16511]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14020
diff
changeset
|
1642 | g_free(title); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1643 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1644 | |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1645 | static void |
|
18391
a51451368934
Show better tooltips for contacts.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18369
diff
changeset
|
1646 | tooltip_for_buddy(PurpleBuddy *buddy, GString *str, gboolean full) |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1647 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
1648 | PurpleProtocol *protocol; |
| 15884 | 1649 | PurpleAccount *account; |
| 1650 | PurpleNotifyUserInfo *user_info; | |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
1651 | PurplePresence *presence; |
| 15884 | 1652 | const char *alias = purple_buddy_get_alias(buddy); |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1653 | char *tmp, *strip; |
|
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1654 | |
| 15884 | 1655 | user_info = purple_notify_user_info_new(); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1656 | |
| 15884 | 1657 | account = purple_buddy_get_account(buddy); |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
1658 | presence = purple_buddy_get_presence(buddy); |
|
15113
956d8ac87bf6
[gaim-migrate @ 17835]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15083
diff
changeset
|
1659 | |
|
19425
07be487bc354
Fix #2607. (Finch tooltip HTML display)
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18909
diff
changeset
|
1660 | if (!full || g_utf8_collate(purple_buddy_get_name(buddy), alias)) { |
|
32188
cb9cad610bc6
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents:
31601
diff
changeset
|
1661 | purple_notify_user_info_add_pair_plaintext(user_info, _("Nickname"), alias); |
|
19425
07be487bc354
Fix #2607. (Finch tooltip HTML display)
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18909
diff
changeset
|
1662 | } |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1663 | |
|
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1664 | tmp = g_strdup_printf("%s (%s)", |
| 15884 | 1665 | purple_account_get_username(account), |
| 1666 | purple_account_get_protocol_name(account)); | |
|
32188
cb9cad610bc6
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents:
31601
diff
changeset
|
1667 | purple_notify_user_info_add_pair_plaintext(user_info, _("Account"), tmp); |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1668 | g_free(tmp); |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
1669 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36623
diff
changeset
|
1670 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
36632
1f0650e7b1b5
Refactored finch and a bit of libpurple plugins to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1671 | if (protocol) { |
| 36719 | 1672 | purple_protocol_client_iface_tooltip_text(protocol, buddy, user_info, full); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1673 | } |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1674 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16344
diff
changeset
|
1675 | if (purple_prefs_get_bool("/finch/blist/idletime")) { |
| 15884 | 1676 | PurplePresence *pre = purple_buddy_get_presence(buddy); |
| 1677 | if (purple_presence_is_idle(pre)) { | |
| 1678 | time_t idle = purple_presence_get_idle_time(pre); | |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1679 | if (idle > 0) { |
| 15884 | 1680 | char *st = purple_str_seconds_to_string(time(NULL) - idle); |
|
32188
cb9cad610bc6
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents:
31601
diff
changeset
|
1681 | purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), st); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1682 | g_free(st); |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1683 | } |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1684 | } |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1685 | } |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30060
diff
changeset
|
1686 | |
| 15884 | 1687 | tmp = purple_notify_user_info_get_text_with_newline(user_info, "<BR>"); |
| 1688 | purple_notify_user_info_destroy(user_info); | |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1689 | |
| 15884 | 1690 | strip = purple_markup_strip_html(tmp); |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1691 | g_string_append(str, strip); |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
1692 | |
|
18909
ebc3cc277277
Insert a newline in the tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18852
diff
changeset
|
1693 | if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) { |
|
ebc3cc277277
Insert a newline in the tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18852
diff
changeset
|
1694 | g_string_append(str, "\n"); |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
1695 | g_string_append(str, _("On Mobile")); |
|
18909
ebc3cc277277
Insert a newline in the tooltip.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18852
diff
changeset
|
1696 | } |
|
18614
186b07bbc7a3
Show a pimping cool unicode status emblem for buddies on mobile (thanks, elb).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18607
diff
changeset
|
1697 | |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1698 | g_free(strip); |
|
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
15113
diff
changeset
|
1699 | g_free(tmp); |
|
14446
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1700 | } |
|
5f36f08183e8
[gaim-migrate @ 17090]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14441
diff
changeset
|
1701 | |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1702 | static GString* |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1703 | make_sure_text_fits(GString *string) |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1704 | { |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1705 | int maxw = getmaxx(stdscr) - 3; |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1706 | char *str = gnt_util_onscreen_fit_string(string->str, maxw); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1707 | string = g_string_assign(string, str); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1708 | g_free(str); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1709 | return string; |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1710 | } |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1711 | |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1712 | static gboolean |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1713 | draw_tooltip_real(FinchBlist *ggblist) |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1714 | { |
| 15884 | 1715 | PurpleBlistNode *node; |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1716 | int x, y, top, width, w, h; |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
1717 | GString *str = NULL; |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1718 | GntTree *tree; |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1719 | GntWidget *widget, *box, *tv; |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1720 | char *title = NULL; |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1721 | |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1722 | widget = ggblist->tree; |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1723 | tree = GNT_TREE(widget); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1724 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
1725 | if (!gnt_widget_has_focus(ggblist->tree) || |
|
14981
2db0dea6fc9e
[gaim-migrate @ 17691]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14951
diff
changeset
|
1726 | (ggblist->context && !GNT_WIDGET_IS_FLAG_SET(ggblist->context, GNT_WIDGET_INVISIBLE))) |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1727 | return FALSE; |
|
13958
bd1c3bb3f33d
[gaim-migrate @ 16381]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13947
diff
changeset
|
1728 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1729 | if (ggblist->tooltip) |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1730 | { |
|
13931
a0a91e17f899
[gaim-migrate @ 16335]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13927
diff
changeset
|
1731 | /* XXX: Once we can properly redraw on expose events, this can be removed at the end |
|
a0a91e17f899
[gaim-migrate @ 16335]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13927
diff
changeset
|
1732 | * to avoid the blinking*/ |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1733 | remove_tooltip(ggblist); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1734 | } |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1735 | |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1736 | node = gnt_tree_get_selection_data(tree); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1737 | if (!node) |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1738 | return FALSE; |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1739 | |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
1740 | if (!ggblist->manager->create_tooltip(node, &str, &title)) |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1741 | return FALSE; |
| 14489 | 1742 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1743 | gnt_widget_get_position(widget, &x, &y); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1744 | gnt_widget_get_size(widget, &width, NULL); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1745 | top = gnt_tree_get_selection_visible_line(tree); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1746 | |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1747 | x += width; |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1748 | y += top - 1; |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1749 | |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1750 | box = gnt_box_new(FALSE, FALSE); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1751 | gnt_box_set_toplevel(GNT_BOX(box), TRUE); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1752 | GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1753 | gnt_box_set_title(GNT_BOX(box), title); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1754 | |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1755 | str = make_sure_text_fits(str); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1756 | gnt_util_get_text_bound(str->str, &w, &h); |
|
18369
5a713a62b959
Use the new flags to make the tooltip look better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
1757 | h = MAX(1, h); |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1758 | tv = gnt_text_view_new(); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1759 | gnt_widget_set_size(tv, w + 1, h); |
|
18369
5a713a62b959
Use the new flags to make the tooltip look better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
1760 | gnt_text_view_set_flag(GNT_TEXT_VIEW(tv), GNT_TEXT_VIEW_NO_SCROLL); |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1761 | gnt_box_add_widget(GNT_BOX(box), tv); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1762 | |
|
22579
a84da60f3748
Move the tooltip to the left of the buddylist if there's not enough room to show it on the right.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22556
diff
changeset
|
1763 | if (x + w >= getmaxx(stdscr)) |
|
a84da60f3748
Move the tooltip to the left of the buddylist if there's not enough room to show it on the right.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22556
diff
changeset
|
1764 | x -= w + width + 2; |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1765 | gnt_widget_set_position(box, x, y); |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
1766 | GNT_WIDGET_UNSET_FLAGS(box, GNT_WIDGET_CAN_TAKE_FOCUS); |
|
14104
31fd1353462d
[gaim-migrate @ 16648]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14103
diff
changeset
|
1767 | GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_TRANSIENT); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1768 | gnt_widget_draw(box); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1769 | |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1770 | gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(tv), str->str, GNT_TEXT_FLAG_NORMAL); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1771 | gnt_text_view_scroll(GNT_TEXT_VIEW(tv), 0); |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1772 | |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1773 | g_free(title); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1774 | g_string_free(str, TRUE); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1775 | ggblist->tooltip = box; |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1776 | ggblist->tnode = node; |
|
13931
a0a91e17f899
[gaim-migrate @ 16335]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13927
diff
changeset
|
1777 | |
|
a0a91e17f899
[gaim-migrate @ 16335]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13927
diff
changeset
|
1778 | gnt_widget_set_name(ggblist->tooltip, "tooltip"); |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1779 | return FALSE; |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1780 | } |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1781 | |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1782 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1783 | draw_tooltip(FinchBlist *ggblist) |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1784 | { |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1785 | /* When an account has signed off, it removes one buddy at a time. |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1786 | * Drawing the tooltip after removing each buddy is expensive. On |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1787 | * top of that, if the selected buddy belongs to the disconnected |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1788 | * account, then retreiving the tooltip for that causes crash. So |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1789 | * let's make sure we wait for all the buddies to be removed first.*/ |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1790 | int id = g_timeout_add(0, (GSourceFunc)draw_tooltip_real, ggblist); |
|
14997
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1791 | g_object_set_data_full(G_OBJECT(ggblist->window), "draw_tooltip_calback", |
|
197138c20527
[gaim-migrate @ 17707]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14981
diff
changeset
|
1792 | GINT_TO_POINTER(id), (GDestroyNotify)g_source_remove); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1793 | } |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1794 | |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1795 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1796 | selection_changed(GntWidget *widget, gpointer old, gpointer current, FinchBlist *ggblist) |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1797 | { |
|
16837
d3b8ba967fdc
Fix context menu unusualness in the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16828
diff
changeset
|
1798 | remove_peripherals(ggblist); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1799 | draw_tooltip(ggblist); |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1800 | } |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1801 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1802 | static gboolean |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1803 | context_menu(GntWidget *widget, FinchBlist *ggblist) |
|
14896
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1804 | { |
|
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1805 | draw_context_menu(ggblist); |
|
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1806 | return TRUE; |
|
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1807 | } |
|
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1808 | |
|
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
1809 | static gboolean |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1810 | key_pressed(GntWidget *widget, const char *text, FinchBlist *ggblist) |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1811 | { |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1812 | if (text[0] == 27 && text[1] == 0) { |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1813 | /* Escape was pressed */ |
|
21472
7c77d4a1921d
Cancel the typeahead search when escape is pressed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
1814 | if (gnt_tree_is_searching(GNT_TREE(ggblist->tree))) |
|
7c77d4a1921d
Cancel the typeahead search when escape is pressed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
1815 | gnt_bindable_perform_action_named(GNT_BINDABLE(ggblist->tree), "end-search", NULL); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1816 | remove_peripherals(ggblist); |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1817 | } else if (purple_strequal(text, GNT_KEY_INS)) { |
|
27174
c368e3f44e40
Remove a now-unnecessary binding for the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26871
diff
changeset
|
1818 | PurpleBlistNode *node = gnt_tree_get_selection_data(GNT_TREE(ggblist->tree)); |
|
c368e3f44e40
Remove a now-unnecessary binding for the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26871
diff
changeset
|
1819 | purple_blist_request_add_buddy(NULL, NULL, |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
1820 | node && PURPLE_IS_GROUP(node) ? purple_group_get_name(PURPLE_GROUP(node)) : NULL, |
|
27174
c368e3f44e40
Remove a now-unnecessary binding for the buddylist.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26871
diff
changeset
|
1821 | NULL); |
|
18787
a96af97dc501
New feature: successful compilation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18765
diff
changeset
|
1822 | } else if (!gnt_tree_is_searching(GNT_TREE(ggblist->tree))) { |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1823 | if (purple_strequal(text, "t")) { |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1824 | finch_blist_toggle_tag_buddy(gnt_tree_get_selection_data(GNT_TREE(ggblist->tree))); |
|
28631
d0b410479721
Add missing null sentinels, and help the compiler catch such errors.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
28088
diff
changeset
|
1825 | gnt_bindable_perform_action_named(GNT_BINDABLE(ggblist->tree), "move-down", NULL); |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1826 | } else if (purple_strequal(text, "a")) { |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1827 | finch_blist_place_tagged(gnt_tree_get_selection_data(GNT_TREE(ggblist->tree))); |
|
15228
b3a992ff3e5f
[gaim-migrate @ 17952]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15222
diff
changeset
|
1828 | } else |
|
b3a992ff3e5f
[gaim-migrate @ 17952]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15222
diff
changeset
|
1829 | return FALSE; |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1830 | } else |
|
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1831 | return FALSE; |
|
13947
a77f6f615c20
[gaim-migrate @ 16365]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13946
diff
changeset
|
1832 | |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1833 | return TRUE; |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1834 | } |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
1835 | |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1836 | static void |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1837 | update_node_display(PurpleBlistNode *node, FinchBlist *ggblist) |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1838 | { |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
1839 | GntTextFormatFlags flag = get_blist_node_flag(node); |
|
16636
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1840 | gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), node, flag); |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1841 | } |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1842 | |
|
7f37767fa737
This makes it possible to rearrange chats and groups using the tag+attach system. Thanks a bunch to wabz for testing this. Fixes #379.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16555
diff
changeset
|
1843 | static void |
| 15884 | 1844 | update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist) |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1845 | { |
| 15884 | 1846 | PurpleContact *contact; |
|
21808
2684d3deb32e
Refactor the code a little bit.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21807
diff
changeset
|
1847 | |
| 15884 | 1848 | contact = purple_buddy_get_contact(buddy); |
|
14447
32f854416012
[gaim-migrate @ 17091]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14446
diff
changeset
|
1849 | |
| 15884 | 1850 | gnt_tree_change_text(GNT_TREE(ggblist->tree), buddy, 0, get_display_name((PurpleBlistNode*)buddy)); |
| 1851 | gnt_tree_change_text(GNT_TREE(ggblist->tree), contact, 0, get_display_name((PurpleBlistNode*)contact)); | |
|
14447
32f854416012
[gaim-migrate @ 17091]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14446
diff
changeset
|
1852 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
1853 | blist_update_row_flags((PurpleBlistNode *)buddy); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
1854 | if (buddy == purple_contact_get_priority_buddy(contact)) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
1855 | blist_update_row_flags((PurpleBlistNode *)contact); |
|
15039
20a0d0117a47
[gaim-migrate @ 17756]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14997
diff
changeset
|
1856 | |
| 15884 | 1857 | if (ggblist->tnode == (PurpleBlistNode*)buddy) |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1858 | draw_tooltip(ggblist); |
|
13993
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1859 | } |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1860 | |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1861 | static void |
| 15884 | 1862 | buddy_status_changed(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *now, FinchBlist *ggblist) |
|
13993
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1863 | { |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1864 | update_buddy_display(buddy, ggblist); |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1865 | } |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1866 | |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1867 | static void |
| 15884 | 1868 | buddy_idle_changed(PurpleBuddy *buddy, int old, int new, FinchBlist *ggblist) |
|
13993
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1869 | { |
|
8c12e7d15b40
[gaim-migrate @ 16458]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13989
diff
changeset
|
1870 | update_buddy_display(buddy, ggblist); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1871 | } |
|
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
1872 | |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1873 | static void |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
1874 | remove_peripherals(FinchBlist *ggblist) |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1875 | { |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1876 | if (ggblist->tooltip) |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1877 | remove_tooltip(ggblist); |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1878 | else if (ggblist->context) |
|
14905
23f31a7acc73
[gaim-migrate @ 17612]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14896
diff
changeset
|
1879 | gnt_widget_destroy(ggblist->context); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1880 | } |
|
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
1881 | |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1882 | static void |
| 14908 | 1883 | size_changed_cb(GntWidget *w, int wi, int h) |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1884 | { |
| 14908 | 1885 | int width, height; |
| 1886 | gnt_widget_get_size(w, &width, &height); | |
| 15884 | 1887 | purple_prefs_set_int(PREF_ROOT "/size/width", width); |
| 1888 | purple_prefs_set_int(PREF_ROOT "/size/height", height); | |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1889 | } |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1890 | |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1891 | static void |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1892 | save_position_cb(GntWidget *w, int x, int y) |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1893 | { |
| 15884 | 1894 | purple_prefs_set_int(PREF_ROOT "/position/x", x); |
| 1895 | purple_prefs_set_int(PREF_ROOT "/position/y", y); | |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1896 | } |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
1897 | |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1898 | static void |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1899 | reset_blist_window(GntWidget *window, gpointer null) |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1900 | { |
| 15884 | 1901 | PurpleBlistNode *node; |
| 1902 | purple_signals_disconnect_by_handle(finch_blist_get_handle()); | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
1903 | FINCH_SET_DATA(purple_blist_get_buddy_list(), NULL); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1904 | |
| 15884 | 1905 | node = purple_blist_get_root(); |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
1906 | while (node) { |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
1907 | reset_blist_node_ui_data(node); |
| 15884 | 1908 | node = purple_blist_node_next(node, TRUE); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1909 | } |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1910 | |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
1911 | if (ggblist->typing) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
1912 | g_source_remove(ggblist->typing); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1913 | remove_peripherals(ggblist); |
|
15046
e17788e5403a
[gaim-migrate @ 17763]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15039
diff
changeset
|
1914 | if (ggblist->tagged) |
|
e17788e5403a
[gaim-migrate @ 17763]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15039
diff
changeset
|
1915 | g_list_free(ggblist->tagged); |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
1916 | |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
1917 | if (ggblist->new_group_timeout) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
1918 | g_source_remove(ggblist->new_group_timeout); |
|
24450
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
1919 | if (ggblist->new_group) |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
1920 | g_list_free(ggblist->new_group); |
|
b41b4278c53a
Show a manually added new empty group even if the preference is not set.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24198
diff
changeset
|
1921 | |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1922 | g_free(ggblist); |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1923 | ggblist = NULL; |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1924 | } |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1925 | |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1926 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
1927 | populate_buddylist(void) |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1928 | { |
| 15884 | 1929 | PurpleBlistNode *node; |
| 1930 | PurpleBuddyList *list; | |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1931 | |
|
22312
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
1932 | if (ggblist->manager->init) |
|
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
1933 | ggblist->manager->init(); |
|
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
1934 | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1935 | if (purple_strequal(purple_prefs_get_string(PREF_ROOT "/sort_type"), "text")) { |
| 14774 | 1936 | gnt_tree_set_compare_func(GNT_TREE(ggblist->tree), |
| 1937 | (GCompareFunc)blist_node_compare_text); | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1938 | } else if (purple_strequal(purple_prefs_get_string(PREF_ROOT "/sort_type"), "status")) { |
| 14774 | 1939 | gnt_tree_set_compare_func(GNT_TREE(ggblist->tree), |
| 1940 | (GCompareFunc)blist_node_compare_status); | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
1941 | } else if (purple_strequal(purple_prefs_get_string(PREF_ROOT "/sort_type"), "log")) { |
| 14774 | 1942 | gnt_tree_set_compare_func(GNT_TREE(ggblist->tree), |
| 1943 | (GCompareFunc)blist_node_compare_log); | |
| 1944 | } | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30060
diff
changeset
|
1945 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
1946 | list = purple_blist_get_buddy_list(); |
| 15884 | 1947 | node = purple_blist_get_root(); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1948 | while (node) |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1949 | { |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1950 | node_update(list, node); |
| 15884 | 1951 | node = purple_blist_node_next(node, FALSE); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1952 | } |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1953 | } |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
1954 | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1955 | static void |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1956 | destroy_status_list(GList *list) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1957 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1958 | g_list_foreach(list, (GFunc)g_free, NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1959 | g_list_free(list); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1960 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1961 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1962 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
1963 | populate_status_dropdown(void) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1964 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1965 | int i; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1966 | GList *iter; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1967 | GList *items = NULL; |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
1968 | StatusBoxItem *item = NULL; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1969 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1970 | /* First the primitives */ |
| 15884 | 1971 | PurpleStatusPrimitive prims[] = {PURPLE_STATUS_AVAILABLE, PURPLE_STATUS_AWAY, |
| 1972 | PURPLE_STATUS_INVISIBLE, PURPLE_STATUS_OFFLINE, PURPLE_STATUS_UNSET}; | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1973 | |
|
14555
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
1974 | gnt_combo_box_remove_all(GNT_COMBO_BOX(ggblist->status)); |
|
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
1975 | |
| 15884 | 1976 | for (i = 0; prims[i] != PURPLE_STATUS_UNSET; i++) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1977 | { |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
1978 | item = g_new0(StatusBoxItem, 1); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1979 | item->type = STATUS_PRIMITIVE; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1980 | item->u.prim = prims[i]; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1981 | items = g_list_prepend(items, item); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1982 | gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, |
| 15884 | 1983 | purple_primitive_get_name_from_type(prims[i])); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1984 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1985 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1986 | /* Now the popular statuses */ |
|
18851
87634d109f57
Memory leak fix.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18850
diff
changeset
|
1987 | for (iter = purple_savedstatuses_get_popular(6); iter; iter = g_list_delete_link(iter, iter)) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1988 | { |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
1989 | item = g_new0(StatusBoxItem, 1); |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
1990 | item->type = STATUS_SAVED_POPULAR; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1991 | item->u.saved = iter->data; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1992 | items = g_list_prepend(items, item); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1993 | gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, |
| 15884 | 1994 | purple_savedstatus_get_title(iter->data)); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1995 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
1996 | |
|
14194
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
1997 | /* New savedstatus */ |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
1998 | item = g_new0(StatusBoxItem, 1); |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
1999 | item->type = STATUS_SAVED_NEW; |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2000 | items = g_list_prepend(items, item); |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2001 | gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2002 | _("New...")); |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2003 | |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2004 | /* More savedstatuses */ |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2005 | item = g_new0(StatusBoxItem, 1); |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2006 | item->type = STATUS_SAVED_ALL; |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2007 | items = g_list_prepend(items, item); |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2008 | gnt_combo_box_add_data(GNT_COMBO_BOX(ggblist->status), item, |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2009 | _("Saved...")); |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2010 | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2011 | /* The keys for the combobox are created here, and never used |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2012 | * anywhere else. So make sure the keys are freed when the widget |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2013 | * is destroyed. */ |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2014 | g_object_set_data_full(G_OBJECT(ggblist->status), "list of statuses", |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2015 | items, (GDestroyNotify)destroy_status_list); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2016 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2017 | |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2018 | static void |
| 15884 | 2019 | redraw_blist(const char *name, PurplePrefType type, gconstpointer val, gpointer data) |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2020 | { |
| 15884 | 2021 | PurpleBlistNode *node, *sel; |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2022 | FinchBlistManager *manager; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2023 | |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2024 | if (ggblist == NULL) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2025 | return; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2026 | |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2027 | manager = finch_blist_manager_find(purple_prefs_get_string(PREF_ROOT "/grouping")); |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2028 | if (manager == NULL) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2029 | manager = &default_manager; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2030 | if (ggblist->manager != manager) { |
|
22312
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
2031 | if (ggblist->manager->uninit) |
|
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
2032 | ggblist->manager->uninit(); |
|
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
2033 | |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2034 | ggblist->manager = manager; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2035 | if (manager->can_add_node == NULL) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2036 | manager->can_add_node = default_can_add_node; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2037 | if (manager->find_parent == NULL) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2038 | manager->find_parent = default_find_parent; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2039 | if (manager->create_tooltip == NULL) |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2040 | manager->create_tooltip = default_create_tooltip; |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2041 | } |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2042 | |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2043 | if (ggblist->window == NULL) |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2044 | return; |
|
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2045 | |
|
14531
4beceb49b547
[gaim-migrate @ 17185]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14489
diff
changeset
|
2046 | sel = gnt_tree_get_selection_data(GNT_TREE(ggblist->tree)); |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2047 | gnt_tree_remove_all(GNT_TREE(ggblist->tree)); |
|
22312
dae4ed366fcb
Init and uninit the buddylist managers at appropriate times.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22303
diff
changeset
|
2048 | |
| 15884 | 2049 | node = purple_blist_get_root(); |
| 2050 | for (; node; node = purple_blist_node_next(node, TRUE)) | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2051 | reset_blist_node_ui_data(node); |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2052 | populate_buddylist(); |
|
14531
4beceb49b547
[gaim-migrate @ 17185]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14489
diff
changeset
|
2053 | gnt_tree_set_selected(GNT_TREE(ggblist->tree), sel); |
|
4beceb49b547
[gaim-migrate @ 17185]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14489
diff
changeset
|
2054 | draw_tooltip(ggblist); |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2055 | } |
|
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2056 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
2057 | void finch_blist_init() |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
2058 | { |
|
21855
fc93ce6595e4
Add color to the conversation window to indicate various message attributes
Richard Nelson <wabz@pidgin.im>
parents:
21808
diff
changeset
|
2059 | color_available = gnt_style_get_color(NULL, "color-available"); |
|
21807
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2060 | if (!color_available) |
|
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2061 | color_available = gnt_color_add_pair(COLOR_GREEN, -1); |
|
21855
fc93ce6595e4
Add color to the conversation window to indicate various message attributes
Richard Nelson <wabz@pidgin.im>
parents:
21808
diff
changeset
|
2062 | color_away = gnt_style_get_color(NULL, "color-away"); |
|
21807
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2063 | if (!color_away) |
|
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2064 | color_away = gnt_color_add_pair(COLOR_BLUE, -1); |
|
21855
fc93ce6595e4
Add color to the conversation window to indicate various message attributes
Richard Nelson <wabz@pidgin.im>
parents:
21808
diff
changeset
|
2065 | color_idle = gnt_style_get_color(NULL, "color-idle"); |
|
21807
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2066 | if (!color_idle) |
|
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2067 | color_idle = gnt_color_add_pair(COLOR_CYAN, -1); |
|
21855
fc93ce6595e4
Add color to the conversation window to indicate various message attributes
Richard Nelson <wabz@pidgin.im>
parents:
21808
diff
changeset
|
2068 | color_offline = gnt_style_get_color(NULL, "color-offline"); |
|
21807
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2069 | if (!color_offline) |
|
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2070 | color_offline = gnt_color_add_pair(COLOR_RED, -1); |
|
3d64cf4a1601
Update the changelogs. Correct the man page. Allow 'default' to mean the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21804
diff
changeset
|
2071 | |
| 15884 | 2072 | purple_prefs_add_none(PREF_ROOT); |
| 2073 | purple_prefs_add_none(PREF_ROOT "/size"); | |
| 2074 | purple_prefs_add_int(PREF_ROOT "/size/width", 20); | |
| 2075 | purple_prefs_add_int(PREF_ROOT "/size/height", 17); | |
| 2076 | purple_prefs_add_none(PREF_ROOT "/position"); | |
| 2077 | purple_prefs_add_int(PREF_ROOT "/position/x", 0); | |
| 2078 | purple_prefs_add_int(PREF_ROOT "/position/y", 0); | |
| 2079 | purple_prefs_add_bool(PREF_ROOT "/idletime", TRUE); | |
| 2080 | purple_prefs_add_bool(PREF_ROOT "/showoffline", FALSE); | |
|
18625
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2081 | purple_prefs_add_bool(PREF_ROOT "/emptygroups", FALSE); |
| 15884 | 2082 | purple_prefs_add_string(PREF_ROOT "/sort_type", "text"); |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2083 | purple_prefs_add_string(PREF_ROOT "/grouping", "default"); |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
2084 | |
| 15884 | 2085 | purple_prefs_connect_callback(finch_blist_get_handle(), |
|
18625
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2086 | PREF_ROOT "/emptygroups", redraw_blist, NULL); |
|
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2087 | purple_prefs_connect_callback(finch_blist_get_handle(), |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2088 | PREF_ROOT "/showoffline", redraw_blist, NULL); |
| 15884 | 2089 | purple_prefs_connect_callback(finch_blist_get_handle(), |
| 14774 | 2090 | PREF_ROOT "/sort_type", redraw_blist, NULL); |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2091 | purple_prefs_connect_callback(finch_blist_get_handle(), |
|
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2092 | PREF_ROOT "/grouping", redraw_blist, NULL); |
|
14461
ed494fb68279
[gaim-migrate @ 17107]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14458
diff
changeset
|
2093 | |
|
30039
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2094 | purple_signal_connect_priority(purple_connections_get_handle(), |
|
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2095 | "autojoin", purple_blist_get_handle(), |
|
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2096 | G_CALLBACK(account_autojoin_cb), NULL, |
|
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2097 | PURPLE_SIGNAL_PRIORITY_HIGHEST); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2098 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2099 | finch_blist_install_manager(&default_manager); |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2100 | |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
2101 | return; |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
2102 | } |
|
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
2103 | |
|
14109
1af2b9d5ef3f
[gaim-migrate @ 16660]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14104
diff
changeset
|
2104 | static gboolean |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2105 | remove_typing_cb(gpointer null) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2106 | { |
| 15884 | 2107 | PurpleSavedStatus *current; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2108 | const char *message, *newmessage; |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2109 | char *escnewmessage; |
| 15884 | 2110 | PurpleStatusPrimitive prim, newprim; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2111 | StatusBoxItem *item; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2112 | |
| 15884 | 2113 | current = purple_savedstatus_get_current(); |
| 2114 | message = purple_savedstatus_get_message(current); | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
2115 | prim = purple_savedstatus_get_primitive_type(current); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2116 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2117 | newmessage = gnt_entry_get_text(GNT_ENTRY(ggblist->statustext)); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2118 | item = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(ggblist->status)); |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2119 | escnewmessage = newmessage ? g_markup_escape_text(newmessage, -1) : NULL; |
|
16719
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2120 | |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2121 | switch (item->type) { |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2122 | case STATUS_PRIMITIVE: |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2123 | newprim = item->u.prim; |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2124 | break; |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2125 | case STATUS_SAVED_POPULAR: |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
2126 | newprim = purple_savedstatus_get_primitive_type(item->u.saved); |
|
16719
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2127 | break; |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2128 | default: |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2129 | goto end; /* 'New' or 'Saved' is selected, but this should never happen. */ |
|
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2130 | } |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2131 | |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2132 | if (newprim != prim || ((message && !escnewmessage) || |
|
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2133 | (!message && escnewmessage) || |
|
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2134 | (message && escnewmessage && g_utf8_collate(message, escnewmessage) != 0))) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2135 | { |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2136 | PurpleSavedStatus *status = purple_savedstatus_find_transient_by_type_and_message(newprim, escnewmessage); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2137 | /* Holy Crap! That's a LAWNG function name */ |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2138 | if (status == NULL) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2139 | { |
| 15884 | 2140 | status = purple_savedstatus_new(NULL, newprim); |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2141 | purple_savedstatus_set_message(status, escnewmessage); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2142 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2143 | |
| 15884 | 2144 | purple_savedstatus_activate(status); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2145 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2146 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2147 | gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); |
|
16719
b54dafede4bd
A rare crash fix for finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16636
diff
changeset
|
2148 | end: |
|
24799
d166acdb3a43
Properly escape the status message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24504
diff
changeset
|
2149 | g_free(escnewmessage); |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14109
diff
changeset
|
2150 | if (ggblist->typing) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2151 | g_source_remove(ggblist->typing); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2152 | ggblist->typing = 0; |
|
14109
1af2b9d5ef3f
[gaim-migrate @ 16660]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14104
diff
changeset
|
2153 | return FALSE; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2154 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2155 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2156 | static void |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2157 | status_selection_changed(GntComboBox *box, StatusBoxItem *old, StatusBoxItem *now, gpointer null) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2158 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2159 | gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), NULL); |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2160 | if (now->type == STATUS_SAVED_POPULAR) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2161 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2162 | /* Set the status immediately */ |
| 15884 | 2163 | purple_savedstatus_activate(now->u.saved); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2164 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2165 | else if (now->type == STATUS_PRIMITIVE) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2166 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2167 | /* Move the focus to the entry box */ |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14109
diff
changeset
|
2168 | /* XXX: Make sure the selected status can have a message */ |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2169 | gnt_box_move_focus(GNT_BOX(ggblist->window), 1); |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2170 | ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, (GSourceFunc)remove_typing_cb, NULL); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2171 | } |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2172 | else if (now->type == STATUS_SAVED_ALL) |
|
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2173 | { |
|
14193
fcfd3eea2160
[gaim-migrate @ 16773]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14188
diff
changeset
|
2174 | /* Restore the selection to reflect current status. */ |
| 15884 | 2175 | savedstatus_changed(purple_savedstatus_get_current(), NULL); |
|
14193
fcfd3eea2160
[gaim-migrate @ 16773]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14188
diff
changeset
|
2176 | gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
2177 | finch_savedstatus_show_all(); |
|
14188
cff503f91616
[gaim-migrate @ 16764]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
2178 | } |
|
14194
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2179 | else if (now->type == STATUS_SAVED_NEW) |
|
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2180 | { |
| 15884 | 2181 | savedstatus_changed(purple_savedstatus_get_current(), NULL); |
|
14194
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2182 | gnt_box_give_focus_to_child(GNT_BOX(ggblist->window), ggblist->tree); |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
2183 | finch_savedstatus_edit(NULL); |
|
14194
b371a53b1695
[gaim-migrate @ 16774]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14193
diff
changeset
|
2184 | } |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2185 | else |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2186 | g_return_if_reached(); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2187 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2188 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2189 | static gboolean |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2190 | status_text_changed(GntEntry *entry, const char *text, gpointer null) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2191 | { |
|
14109
1af2b9d5ef3f
[gaim-migrate @ 16660]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14104
diff
changeset
|
2192 | if ((text[0] == 27 || (text[0] == '\t' && text[1] == '\0')) && ggblist->typing == 0) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2193 | return FALSE; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2194 | |
|
14121
3d8804b82150
[gaim-migrate @ 16674]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14109
diff
changeset
|
2195 | if (ggblist->typing) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2196 | g_source_remove(ggblist->typing); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2197 | ggblist->typing = 0; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2198 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2199 | if (text[0] == '\r' && text[1] == 0) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2200 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2201 | /* Set the status only after you press 'Enter' */ |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2202 | remove_typing_cb(NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2203 | return TRUE; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2204 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2205 | |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2206 | ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, (GSourceFunc)remove_typing_cb, NULL); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2207 | return FALSE; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2208 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2209 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2210 | static void |
| 15884 | 2211 | savedstatus_changed(PurpleSavedStatus *now, PurpleSavedStatus *old) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2212 | { |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2213 | GList *list; |
| 15884 | 2214 | PurpleStatusPrimitive prim; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2215 | const char *message; |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2216 | gboolean found = FALSE, saved = TRUE; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2217 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2218 | if (!ggblist) |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2219 | return; |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2220 | |
|
14555
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
2221 | /* Block the signals we don't want to emit */ |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2222 | g_signal_handlers_block_matched(ggblist->status, G_SIGNAL_MATCH_FUNC, |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2223 | 0, 0, NULL, status_selection_changed, NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2224 | g_signal_handlers_block_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC, |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2225 | 0, 0, NULL, status_text_changed, NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2226 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
2227 | prim = purple_savedstatus_get_primitive_type(now); |
| 15884 | 2228 | message = purple_savedstatus_get_message(now); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2229 | |
|
14555
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
2230 | /* Rebuild the status dropdown */ |
|
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
2231 | populate_status_dropdown(); |
|
0d6ef581e3ac
[gaim-migrate @ 17212]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14539
diff
changeset
|
2232 | |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2233 | while (!found) { |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2234 | list = g_object_get_data(G_OBJECT(ggblist->status), "list of statuses"); |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2235 | for (; list; list = list->next) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2236 | { |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2237 | StatusBoxItem *item = list->data; |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2238 | if ((saved && item->type != STATUS_PRIMITIVE && item->u.saved == now) || |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2239 | (!saved && item->type == STATUS_PRIMITIVE && item->u.prim == prim)) |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2240 | { |
| 15884 | 2241 | char *mess = purple_unescape_html(message); |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2242 | gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item); |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2243 | gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), mess); |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2244 | gnt_widget_draw(ggblist->status); |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2245 | g_free(mess); |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2246 | found = TRUE; |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2247 | break; |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2248 | } |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2249 | } |
|
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2250 | if (!saved) |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2251 | break; |
|
15564
61befe113a13
Wonderful patch from Richard 'wabz' Nelson to fix the bug of lacking a pounce ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15377
diff
changeset
|
2252 | saved = FALSE; |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2253 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2254 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2255 | g_signal_handlers_unblock_matched(ggblist->status, G_SIGNAL_MATCH_FUNC, |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2256 | 0, 0, NULL, status_selection_changed, NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2257 | g_signal_handlers_unblock_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC, |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2258 | 0, 0, NULL, status_text_changed, NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2259 | } |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
2260 | |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2261 | static int |
|
16555
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2262 | blist_node_compare_position(PurpleBlistNode *n1, PurpleBlistNode *n2) |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2263 | { |
|
22334
6eec04817c0d
Add API so Finch doesn't need to touch the internals of PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22314
diff
changeset
|
2264 | while ((n1 = purple_blist_node_get_sibling_prev(n1)) != NULL) |
|
16555
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2265 | if (n1 == n2) |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2266 | return 1; |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2267 | return -1; |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2268 | } |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2269 | |
|
9f8c3a97fb35
Never change the orders of chats or the groups.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2270 | static int |
| 15884 | 2271 | blist_node_compare_text(PurpleBlistNode *n1, PurpleBlistNode *n2) |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2272 | { |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2273 | const char *s1, *s2; |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2274 | char *us1, *us2; |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2275 | int ret; |
|
17333
dfb8dfb6ede0
It's valid for different types to be compared. In that case, use existing positions.
Richard Nelson <wabz@pidgin.im>
parents:
17295
diff
changeset
|
2276 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2277 | if (G_OBJECT_TYPE(n1) != G_OBJECT_TYPE(n2)) |
|
17333
dfb8dfb6ede0
It's valid for different types to be compared. In that case, use existing positions.
Richard Nelson <wabz@pidgin.im>
parents:
17295
diff
changeset
|
2278 | return blist_node_compare_position(n1, n2); |
|
dfb8dfb6ede0
It's valid for different types to be compared. In that case, use existing positions.
Richard Nelson <wabz@pidgin.im>
parents:
17295
diff
changeset
|
2279 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2280 | if (PURPLE_IS_CHAT(n1)) { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2281 | s1 = purple_chat_get_name((PurpleChat*)n1); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2282 | s2 = purple_chat_get_name((PurpleChat*)n2); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2283 | } else if (PURPLE_IS_BUDDY(n1)) { |
|
34849
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2284 | return purple_buddy_presence_compare( |
|
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2285 | PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n1))), |
|
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2286 | PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n2)))); |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2287 | } else if (PURPLE_IS_CONTACT(n1)) { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2288 | s1 = purple_contact_get_alias((PurpleContact*)n1); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2289 | s2 = purple_contact_get_alias((PurpleContact*)n2); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2290 | } else { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2291 | return blist_node_compare_position(n1, n2); |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2292 | } |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2293 | |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2294 | us1 = g_utf8_strup(s1, -1); |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2295 | us2 = g_utf8_strup(s2, -1); |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2296 | ret = g_utf8_collate(us1, us2); |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2297 | g_free(us1); |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2298 | g_free(us2); |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2299 | |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2300 | return ret; |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2301 | } |
|
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14127
diff
changeset
|
2302 | |
| 14774 | 2303 | static int |
| 15884 | 2304 | blist_node_compare_status(PurpleBlistNode *n1, PurpleBlistNode *n2) |
| 14774 | 2305 | { |
| 2306 | int ret; | |
| 2307 | ||
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2308 | if (G_OBJECT_TYPE(n1) != G_OBJECT_TYPE(n2)) |
|
17333
dfb8dfb6ede0
It's valid for different types to be compared. In that case, use existing positions.
Richard Nelson <wabz@pidgin.im>
parents:
17295
diff
changeset
|
2309 | return blist_node_compare_position(n1, n2); |
| 14774 | 2310 | |
|
35914
e05ac5e585d0
Finch: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35587
diff
changeset
|
2311 | if (PURPLE_IS_CONTACT(n1)) |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2312 | n1 = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(n1))); |
|
35914
e05ac5e585d0
Finch: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35587
diff
changeset
|
2313 | if (PURPLE_IS_CONTACT(n2)) |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2314 | n2 = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(n2))); |
|
35914
e05ac5e585d0
Finch: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35587
diff
changeset
|
2315 | |
|
e05ac5e585d0
Finch: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35587
diff
changeset
|
2316 | if (PURPLE_IS_BUDDY(n1) && PURPLE_IS_BUDDY(n2)) { |
|
34849
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2317 | ret = purple_buddy_presence_compare( |
|
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2318 | PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n1))), |
|
4676b30130c9
Refactored finch to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34760
diff
changeset
|
2319 | PURPLE_BUDDY_PRESENCE(purple_buddy_get_presence(PURPLE_BUDDY(n2)))); |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2320 | if (ret != 0) |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2321 | return ret; |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2322 | } else { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2323 | return blist_node_compare_position(n1, n2); |
| 14774 | 2324 | } |
| 2325 | ||
| 2326 | /* Sort alphabetically if presence is not comparable */ | |
| 2327 | ret = blist_node_compare_text(n1, n2); | |
| 2328 | ||
| 2329 | return ret; | |
| 2330 | } | |
| 2331 | ||
| 2332 | static int | |
| 15884 | 2333 | get_contact_log_size(PurpleBlistNode *c) |
| 14774 | 2334 | { |
| 2335 | int log = 0; | |
| 15884 | 2336 | PurpleBlistNode *node; |
| 14774 | 2337 | |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
2338 | for (node = purple_blist_node_get_first_child(c); node; node = purple_blist_node_get_sibling_next(node)) { |
| 15884 | 2339 | PurpleBuddy *b = (PurpleBuddy*)node; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
2340 | log += purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b), |
|
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
2341 | purple_buddy_get_account(b)); |
| 14774 | 2342 | } |
| 2343 | ||
| 2344 | return log; | |
| 2345 | } | |
| 2346 | ||
| 2347 | static int | |
| 15884 | 2348 | blist_node_compare_log(PurpleBlistNode *n1, PurpleBlistNode *n2) |
| 14774 | 2349 | { |
| 2350 | int ret; | |
| 15884 | 2351 | PurpleBuddy *b1, *b2; |
| 14774 | 2352 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2353 | if (G_OBJECT_TYPE(n1) != G_OBJECT_TYPE(n2)) |
|
17333
dfb8dfb6ede0
It's valid for different types to be compared. In that case, use existing positions.
Richard Nelson <wabz@pidgin.im>
parents:
17295
diff
changeset
|
2354 | return blist_node_compare_position(n1, n2); |
| 14774 | 2355 | |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2356 | if (PURPLE_IS_BUDDY(n1)) { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2357 | b1 = (PurpleBuddy*)n1; |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2358 | b2 = (PurpleBuddy*)n2; |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2359 | ret = purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b2), purple_buddy_get_account(b2)) - |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2360 | purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b1), purple_buddy_get_account(b1)); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2361 | if (ret != 0) |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2362 | return ret; |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2363 | } else if (PURPLE_IS_CONTACT(n1)) { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2364 | ret = get_contact_log_size(n2) - get_contact_log_size(n1); |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2365 | if (ret != 0) |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2366 | return ret; |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2367 | } else { |
|
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2368 | return blist_node_compare_position(n1, n2); |
| 14774 | 2369 | } |
|
34737
60d32106f808
Refactored finch to use the GObject BList API. Added purple_chat_get_name_only().
Ankit Vani <a@nevitus.org>
parents:
34736
diff
changeset
|
2370 | |
| 14774 | 2371 | ret = blist_node_compare_text(n1, n2); |
| 2372 | return ret; | |
| 2373 | } | |
| 2374 | ||
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2375 | static void |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2376 | plugin_action(GntMenuItem *item, gpointer data) |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2377 | { |
| 15884 | 2378 | PurplePluginAction *action = data; |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2379 | if (action && action->callback) |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2380 | action->callback(action); |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2381 | } |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2382 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2383 | static void |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2384 | build_plugin_actions(GntMenuItem *item, PurplePlugin *plugin) |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2385 | { |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2386 | GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP); |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36896
diff
changeset
|
2387 | PurplePluginActionsCb actions_cb; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2388 | GList *actions; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2389 | GntMenuItem *menuitem; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2390 | |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36896
diff
changeset
|
2391 | actions_cb = |
|
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36896
diff
changeset
|
2392 | purple_plugin_info_get_actions_cb(purple_plugin_get_info(plugin)); |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2393 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2394 | gnt_menuitem_set_submenu(item, GNT_MENU(sub)); |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36896
diff
changeset
|
2395 | for (actions = actions_cb(plugin); actions; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2396 | actions = g_list_delete_link(actions, actions)) { |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2397 | if (actions->data) { |
| 15884 | 2398 | PurplePluginAction *action = actions->data; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2399 | action->plugin = plugin; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2400 | menuitem = gnt_menuitem_new(action->label); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2401 | gnt_menu_add_item(GNT_MENU(sub), menuitem); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2402 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2403 | gnt_menuitem_set_callback(menuitem, plugin_action, action); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2404 | g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", |
| 15884 | 2405 | action, (GDestroyNotify)purple_plugin_action_free); |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2406 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2407 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2408 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2409 | |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2410 | static void |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2411 | protocol_action(GntMenuItem *item, gpointer data) |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2412 | { |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2413 | PurpleProtocolAction *action = data; |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2414 | if (action && action->callback) |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2415 | action->callback(action); |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2416 | } |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2417 | |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2418 | static void |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
2419 | build_protocol_actions(GntMenuItem *item, PurpleProtocol *protocol, |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2420 | PurpleConnection *gc) |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2421 | { |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2422 | GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2423 | GList *actions; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2424 | GntMenuItem *menuitem; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2425 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2426 | gnt_menuitem_set_submenu(item, GNT_MENU(sub)); |
| 36719 | 2427 | for (actions = purple_protocol_client_iface_get_actions(protocol, gc); actions; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2428 | actions = g_list_delete_link(actions, actions)) { |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2429 | if (actions->data) { |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2430 | PurpleProtocolAction *action = actions->data; |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2431 | action->connection = gc; |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2432 | menuitem = gnt_menuitem_new(action->label); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2433 | gnt_menu_add_item(GNT_MENU(sub), menuitem); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2434 | |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2435 | gnt_menuitem_set_callback(menuitem, protocol_action, action); |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2436 | g_object_set_data_full(G_OBJECT(menuitem), "protocol_action", |
|
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2437 | action, (GDestroyNotify)purple_protocol_action_free); |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2438 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2439 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2440 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2441 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2442 | static gboolean |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2443 | buddy_recent_signed_on_off(gpointer data) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2444 | { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2445 | PurpleBlistNode *node = data; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
2446 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2447 | |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2448 | g_source_remove(fnode->signed_timer); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2449 | fnode->signed_timer = 0; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2450 | |
|
22303
cab9f3452d72
Rework some of the code that deals with adding and removing blist nodes in the tree. There were some typoed code that just happened to work. This fixes those.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22300
diff
changeset
|
2451 | if (!ggblist->manager->can_add_node(node)) { |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
2452 | node_remove(purple_blist_get_buddy_list(), node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2453 | } else { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2454 | update_node_display(node, ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
2455 | if (purple_blist_node_get_parent(node) && PURPLE_IS_CONTACT(purple_blist_node_get_parent(node))) |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
2456 | update_node_display(purple_blist_node_get_parent(node), ggblist); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2457 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2458 | |
|
34716
fc09ccb6eab5
ref buddy before connecting signed off timeout, and unref in the handler
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
2459 | g_object_unref(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2460 | return FALSE; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2461 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2462 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2463 | static gboolean |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2464 | buddy_signed_on_off_cb(gpointer data) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2465 | { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2466 | PurpleBlistNode *node = data; |
|
32715
81e0226a4dd5
Finch: Use purple_blist_node_get_ui_data() and purple_blist_node_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32714
diff
changeset
|
2467 | FinchBlistNode *fnode = purple_blist_node_get_ui_data(node); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2468 | if (!ggblist || !fnode) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2469 | return FALSE; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2470 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2471 | if (fnode->signed_timer) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2472 | g_source_remove(fnode->signed_timer); |
|
34716
fc09ccb6eab5
ref buddy before connecting signed off timeout, and unref in the handler
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
2473 | |
|
fc09ccb6eab5
ref buddy before connecting signed off timeout, and unref in the handler
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
2474 | g_object_ref(node); |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
38358
diff
changeset
|
2475 | fnode->signed_timer = g_timeout_add_seconds(6, (GSourceFunc)buddy_recent_signed_on_off, data); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2476 | update_node_display(node, ggblist); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
2477 | if (purple_blist_node_get_parent(node) && PURPLE_IS_CONTACT(purple_blist_node_get_parent(node))) |
|
22282
a964668bd7e4
Add some accessor functions for PurpleBlistNode.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
2478 | update_node_display(purple_blist_node_get_parent(node), ggblist); |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2479 | return FALSE; |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2480 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2481 | |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2482 | static void |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2483 | buddy_signed_on_off(PurpleBuddy* buddy, gpointer null) |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2484 | { |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2485 | g_idle_add(buddy_signed_on_off_cb, buddy); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2486 | } |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
2487 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2488 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
2489 | reconstruct_plugins_menu(void) |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2490 | { |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2491 | GntWidget *sub; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2492 | GntMenuItem *plg; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2493 | GList *iter; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2494 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2495 | if (!ggblist) |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2496 | return; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2497 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2498 | if (ggblist->plugins == NULL) |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2499 | ggblist->plugins = gnt_menuitem_new(_("Plugins")); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2500 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2501 | plg = ggblist->plugins; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2502 | sub = gnt_menu_new(GNT_MENU_POPUP); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2503 | gnt_menuitem_set_submenu(plg, GNT_MENU(sub)); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2504 | |
| 15884 | 2505 | for (iter = purple_plugins_get_loaded(); iter; iter = iter->next) { |
| 2506 | PurplePlugin *plugin = iter->data; | |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2507 | PurplePluginInfo *info = purple_plugin_get_info(plugin); |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2508 | GntMenuItem *item; |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2509 | |
|
36934
e7268aeb3b89
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
Ankit Vani <a@nevitus.org>
parents:
36896
diff
changeset
|
2510 | if (!purple_plugin_info_get_actions_cb(info)) |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2511 | continue; |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2512 | |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2513 | item = gnt_menuitem_new(_(purple_plugin_info_get_name(info))); |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2514 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
36489
6e8edeb3f3f9
Refactored gntblist to use the actions callbacks
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
2515 | build_plugin_actions(item, plugin); |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2516 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2517 | } |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2518 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2519 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
2520 | reconstruct_accounts_menu(void) |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2521 | { |
| 14774 | 2522 | GntWidget *sub; |
| 2523 | GntMenuItem *acc, *item; | |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2524 | GList *iter; |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2525 | |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2526 | if (!ggblist) |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2527 | return; |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2528 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2529 | if (ggblist->accounts == NULL) |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2530 | ggblist->accounts = gnt_menuitem_new(_("Accounts")); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2531 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2532 | acc = ggblist->accounts; |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2533 | sub = gnt_menu_new(GNT_MENU_POPUP); |
| 14774 | 2534 | gnt_menuitem_set_submenu(acc, GNT_MENU(sub)); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2535 | |
| 15884 | 2536 | for (iter = purple_accounts_get_all_active(); iter; |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2537 | iter = g_list_delete_link(iter, iter)) { |
| 15884 | 2538 | PurpleAccount *account = iter->data; |
| 2539 | PurpleConnection *gc = purple_account_get_connection(account); | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
2540 | PurpleProtocol *protocol; |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2541 | |
| 15884 | 2542 | if (!gc || !PURPLE_CONNECTION_IS_CONNECTED(gc)) |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2543 | continue; |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2544 | protocol = purple_connection_get_protocol(gc); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
2545 | |
|
36724
41150570364f
Refactored finch to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
2546 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT_IFACE, get_actions)) { |
| 15884 | 2547 | item = gnt_menuitem_new(purple_account_get_username(account)); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2548 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36510
diff
changeset
|
2549 | build_protocol_actions(item, protocol, gc); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2550 | } |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2551 | } |
| 14774 | 2552 | } |
| 2553 | ||
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2554 | static void |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2555 | reconstruct_grouping_menu(void) |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2556 | { |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2557 | GList *iter; |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2558 | GntWidget *subsub; |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2559 | |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2560 | if (!ggblist || !ggblist->grouping) |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2561 | return; |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2562 | |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2563 | subsub = gnt_menu_new(GNT_MENU_POPUP); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2564 | gnt_menuitem_set_submenu(ggblist->grouping, GNT_MENU(subsub)); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2565 | |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2566 | for (iter = managers; iter; iter = iter->next) { |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2567 | char menuid[128]; |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2568 | FinchBlistManager *manager = iter->data; |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2569 | GntMenuItem *item = gnt_menuitem_new(_(manager->name)); |
|
25708
7e97dbce8223
applied changes from aa7ce93329f5ccbe74640a92b6656ae402d8eea8
Ethan Blanton <elb@pidgin.im>
parents:
24799
diff
changeset
|
2570 | g_snprintf(menuid, sizeof(menuid), "grouping-%s", manager->id); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2571 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), menuid); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2572 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2573 | g_object_set_data_full(G_OBJECT(item), "grouping-id", g_strdup(manager->id), g_free); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2574 | gnt_menuitem_set_callback(item, menu_group_set_cb, NULL); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2575 | } |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2576 | } |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2577 | |
|
19555
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2578 | static gboolean |
|
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2579 | auto_join_chats(gpointer data) |
|
15242
4f4b5d66f9af
[gaim-migrate @ 17967]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15241
diff
changeset
|
2580 | { |
| 15884 | 2581 | PurpleBlistNode *node; |
|
19555
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2582 | PurpleConnection *pc = data; |
|
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2583 | PurpleAccount *account = purple_connection_get_account(pc); |
|
15242
4f4b5d66f9af
[gaim-migrate @ 17967]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15241
diff
changeset
|
2584 | |
| 15884 | 2585 | for (node = purple_blist_get_root(); node; |
| 2586 | node = purple_blist_node_next(node, FALSE)) { | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
2587 | if (PURPLE_IS_CHAT(node)) { |
| 15884 | 2588 | PurpleChat *chat = (PurpleChat*)node; |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
2589 | if (purple_chat_get_account(chat) == account && |
|
16828
0501ee8b8220
Fix this spectacularly braindead code. I must've been on the good stuff when I wrote this. Fixes #364.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16719
diff
changeset
|
2590 | purple_blist_node_get_bool(node, "gnt-autojoin")) |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
2591 | purple_serv_join_chat(purple_account_get_connection(account), purple_chat_get_components(chat)); |
|
15242
4f4b5d66f9af
[gaim-migrate @ 17967]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15241
diff
changeset
|
2592 | } |
|
4f4b5d66f9af
[gaim-migrate @ 17967]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15241
diff
changeset
|
2593 | } |
|
19555
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2594 | return FALSE; |
|
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2595 | } |
|
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2596 | |
|
30039
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2597 | static gboolean |
|
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2598 | account_autojoin_cb(PurpleConnection *gc, gpointer null) |
|
19555
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2599 | { |
|
9d5c2c048760
I think this fixes the auto-rejoin-after-auto-reconnect bug in finch.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19425
diff
changeset
|
2600 | g_idle_add(auto_join_chats, gc); |
|
30039
9cd7672bae4f
Add an autojoin connection signal
Richard Laager <rlaager@pidgin.im>
parents:
29106
diff
changeset
|
2601 | return TRUE; |
|
15242
4f4b5d66f9af
[gaim-migrate @ 17967]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15241
diff
changeset
|
2602 | } |
|
18626
c2d9efa0ef1a
Minor changes to remove a couple of lines of duplication.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18625
diff
changeset
|
2603 | |
|
c2d9efa0ef1a
Minor changes to remove a couple of lines of duplication.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18625
diff
changeset
|
2604 | static void toggle_pref_cb(GntMenuItem *item, gpointer n) |
|
18625
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2605 | { |
|
18626
c2d9efa0ef1a
Minor changes to remove a couple of lines of duplication.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18625
diff
changeset
|
2606 | purple_prefs_set_bool(n, !purple_prefs_get_bool(n)); |
| 14774 | 2607 | } |
| 2608 | ||
| 2609 | static void sort_blist_change_cb(GntMenuItem *item, gpointer n) | |
| 2610 | { | |
| 15884 | 2611 | purple_prefs_set_string(PREF_ROOT "/sort_type", n); |
| 14774 | 2612 | } |
| 2613 | ||
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2614 | static void |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2615 | block_select_cb(gpointer data, PurpleRequestFields *fields) |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2616 | { |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2617 | PurpleAccount *account = purple_request_fields_get_account(fields, "account"); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2618 | const char *name = purple_request_fields_get_string(fields, "screenname"); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2619 | if (account && name && *name != '\0') { |
|
34338
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
2620 | if (GPOINTER_TO_INT(purple_request_fields_get_choice(fields, "block")) == 1) { |
|
34584
ed2747e0598c
Refactored finch to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33935
diff
changeset
|
2621 | purple_account_privacy_deny(account, name); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2622 | } else { |
|
34584
ed2747e0598c
Refactored finch to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33935
diff
changeset
|
2623 | purple_account_privacy_allow(account, name); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2624 | } |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2625 | } |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2626 | } |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2627 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2628 | static void |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2629 | block_select(GntMenuItem *item, gpointer n) |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2630 | { |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2631 | PurpleRequestFields *fields; |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2632 | PurpleRequestFieldGroup *group; |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2633 | PurpleRequestField *field; |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2634 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2635 | fields = purple_request_fields_new(); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2636 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2637 | group = purple_request_field_group_new(NULL); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2638 | purple_request_fields_add_group(fields, group); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2639 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2640 | field = purple_request_field_string_new("screenname", _("Name"), NULL, FALSE); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2641 | purple_request_field_set_type_hint(field, "screenname"); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2642 | purple_request_field_set_required(field, TRUE); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2643 | purple_request_field_group_add_field(group, field); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2644 | |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2645 | field = purple_request_field_account_new("account", _("Account"), NULL); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2646 | purple_request_field_set_type_hint(field, "account"); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2647 | purple_request_field_set_visible(field, |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2648 | (purple_connections_get_all() != NULL && |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2649 | purple_connections_get_all()->next != NULL)); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2650 | purple_request_field_set_required(field, TRUE); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2651 | purple_request_field_group_add_field(group, field); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2652 | |
|
34338
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
2653 | field = purple_request_field_choice_new("block", _("Block/Unblock"), GINT_TO_POINTER(1)); |
|
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
2654 | purple_request_field_choice_add(field, _("Block"), GINT_TO_POINTER(1)); |
|
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
2655 | purple_request_field_choice_add(field, _("Unblock"), GINT_TO_POINTER(2)); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2656 | purple_request_field_group_add_field(group, field); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2657 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
2658 | purple_request_fields(purple_blist_get_buddy_list(), _("Block/Unblock"), |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2659 | NULL, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22935
diff
changeset
|
2660 | _("Please enter the username or alias of the person " |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2661 | "you would like to Block/Unblock."), |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2662 | fields, |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2663 | _("OK"), G_CALLBACK(block_select_cb), |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2664 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
2665 | NULL, NULL); |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2666 | } |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2667 | |
|
18607
9b0e8be076f0
Fix a bug where buddies from offline accounts were showing up.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18400
diff
changeset
|
2668 | /* send_im_select* -- Xerox */ |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2669 | static void |
| 15884 | 2670 | send_im_select_cb(gpointer data, PurpleRequestFields *fields) |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2671 | { |
| 15884 | 2672 | PurpleAccount *account; |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2673 | const char *username; |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2674 | PurpleIMConversation *im; |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2675 | |
| 15884 | 2676 | account = purple_request_fields_get_account(fields, "account"); |
| 2677 | username = purple_request_fields_get_string(fields, "screenname"); | |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2678 | |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2679 | im = purple_im_conversation_new(account, username); |
|
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2680 | purple_conversation_present(PURPLE_CONVERSATION(im)); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2681 | } |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2682 | |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2683 | static void |
|
14981
2db0dea6fc9e
[gaim-migrate @ 17691]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14951
diff
changeset
|
2684 | send_im_select(GntMenuItem *item, gpointer n) |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2685 | { |
| 15884 | 2686 | PurpleRequestFields *fields; |
| 2687 | PurpleRequestFieldGroup *group; | |
| 2688 | PurpleRequestField *field; | |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2689 | |
| 15884 | 2690 | fields = purple_request_fields_new(); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2691 | |
| 15884 | 2692 | group = purple_request_field_group_new(NULL); |
| 2693 | purple_request_fields_add_group(fields, group); | |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2694 | |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2695 | field = purple_request_field_string_new("screenname", _("Name"), NULL, FALSE); |
| 15884 | 2696 | purple_request_field_set_type_hint(field, "screenname"); |
| 2697 | purple_request_field_set_required(field, TRUE); | |
| 2698 | purple_request_field_group_add_field(group, field); | |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2699 | |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2700 | field = purple_request_field_account_new("account", _("Account"), NULL); |
| 15884 | 2701 | purple_request_field_set_type_hint(field, "account"); |
| 2702 | purple_request_field_set_visible(field, | |
| 2703 | (purple_connections_get_all() != NULL && | |
| 2704 | purple_connections_get_all()->next != NULL)); | |
| 2705 | purple_request_field_set_required(field, TRUE); | |
| 2706 | purple_request_field_group_add_field(group, field); | |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2707 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
2708 | purple_request_fields(purple_blist_get_buddy_list(), _("New Instant Message"), |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2709 | NULL, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22935
diff
changeset
|
2710 | _("Please enter the username or alias of the person " |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2711 | "you would like to IM."), |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2712 | fields, |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2713 | _("OK"), G_CALLBACK(send_im_select_cb), |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2714 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
2715 | NULL, NULL); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2716 | } |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2717 | |
| 14774 | 2718 | static void |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2719 | join_chat_select_cb(gpointer data, PurpleRequestFields *fields) |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2720 | { |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2721 | PurpleAccount *account; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2722 | const char *name; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2723 | PurpleConnection *gc; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2724 | PurpleChat *chat; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2725 | GHashTable *hash = NULL; |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2726 | PurpleChatConversation *conv; |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2727 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2728 | account = purple_request_fields_get_account(fields, "account"); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2729 | name = purple_request_fields_get_string(fields, "chat"); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2730 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2731 | if (!purple_account_is_connected(account)) |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2732 | return; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2733 | |
|
22336
ac905bb0a8ec
Add accessor and update finch to not touch the internals of PurpleConnection.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22335
diff
changeset
|
2734 | gc = purple_account_get_connection(account); |
|
23422
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2735 | /* Create a new conversation now. This will give focus to the new window. |
|
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2736 | * But it's necessary to pretend that we left the chat, because otherwise |
|
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2737 | * a new conversation window will pop up when we finally join the chat. */ |
|
34625
03d62b1660fc
Refactor code to remove conversation type from some instances of purple_conversations_find_with_account()
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
2738 | if (!(conv = purple_conversations_find_chat_with_account(name, account))) { |
|
34627
08733a7475df
Replaced purple_conversation_new() with purple_[im,chat]_conversation_new()
Ankit Vani <a@nevitus.org>
parents:
34625
diff
changeset
|
2739 | conv = purple_chat_conversation_new(account, name); |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2740 | purple_chat_conversation_leave(conv); |
|
23422
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2741 | } else { |
|
34657
b10d6297ffd5
Refactored finch to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
2742 | purple_conversation_present(PURPLE_CONVERSATION(conv)); |
|
23422
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2743 | } |
|
22bc7c68bbc3
Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22988
diff
changeset
|
2744 | |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2745 | chat = purple_blist_find_chat(account, name); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2746 | if (chat == NULL) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2747 | PurpleProtocol *protocol = purple_connection_get_protocol(gc); |
| 36719 | 2748 | hash = purple_protocol_chat_iface_info_defaults(protocol, gc, name); |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2749 | } else { |
|
22341
ed341c90116e
Add accessor and update finch to not touch the internals of PurpleBuddy and PurpleChat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22339
diff
changeset
|
2750 | hash = purple_chat_get_components(chat); |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2751 | } |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35494
diff
changeset
|
2752 | purple_serv_join_chat(gc, hash); |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2753 | if (chat == NULL && hash != NULL) |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2754 | g_hash_table_destroy(hash); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2755 | } |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2756 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2757 | static void |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2758 | join_chat_select(GntMenuItem *item, gpointer n) |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2759 | { |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2760 | PurpleRequestFields *fields; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2761 | PurpleRequestFieldGroup *group; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2762 | PurpleRequestField *field; |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2763 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2764 | fields = purple_request_fields_new(); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2765 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2766 | group = purple_request_field_group_new(NULL); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2767 | purple_request_fields_add_group(fields, group); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2768 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2769 | field = purple_request_field_string_new("chat", _("Channel"), NULL, FALSE); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2770 | purple_request_field_set_required(field, TRUE); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2771 | purple_request_field_group_add_field(group, field); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2772 | |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2773 | field = purple_request_field_account_new("account", _("Account"), NULL); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2774 | purple_request_field_set_type_hint(field, "account"); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2775 | purple_request_field_set_visible(field, |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2776 | (purple_connections_get_all() != NULL && |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2777 | purple_connections_get_all()->next != NULL)); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2778 | purple_request_field_set_required(field, TRUE); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2779 | purple_request_field_group_add_field(group, field); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2780 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
2781 | purple_request_fields(purple_blist_get_buddy_list(), _("Join a Chat"), |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2782 | NULL, |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2783 | _("Please enter the name of the chat you want to join."), |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2784 | fields, |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2785 | _("Join"), G_CALLBACK(join_chat_select_cb), |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2786 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
2787 | NULL, NULL); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2788 | } |
|
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2789 | |
| 14774 | 2790 | static void |
|
22988
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2791 | view_log_select_cb(gpointer data, PurpleRequestFields *fields) |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2792 | { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2793 | PurpleAccount *account; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2794 | const char *name; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2795 | PurpleBuddy *buddy; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2796 | PurpleContact *contact; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2797 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2798 | account = purple_request_fields_get_account(fields, "account"); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2799 | name = purple_request_fields_get_string(fields, "screenname"); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2800 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
2801 | buddy = purple_blist_find_buddy(account, name); |
|
22988
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2802 | if (buddy) { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2803 | contact = purple_buddy_get_contact(buddy); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2804 | } else { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2805 | contact = NULL; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2806 | } |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2807 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2808 | if (contact) { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2809 | finch_log_show_contact(contact); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2810 | } else { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2811 | finch_log_show(PURPLE_LOG_IM, name, account); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2812 | } |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2813 | } |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2814 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2815 | static void |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2816 | view_log_cb(GntMenuItem *item, gpointer n) |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2817 | { |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2818 | PurpleRequestFields *fields; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2819 | PurpleRequestFieldGroup *group; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2820 | PurpleRequestField *field; |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2821 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2822 | fields = purple_request_fields_new(); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2823 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2824 | group = purple_request_field_group_new(NULL); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2825 | purple_request_fields_add_group(fields, group); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2826 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2827 | field = purple_request_field_string_new("screenname", _("Name"), NULL, FALSE); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2828 | purple_request_field_set_type_hint(field, "screenname-all"); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2829 | purple_request_field_set_required(field, TRUE); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2830 | purple_request_field_group_add_field(group, field); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2831 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2832 | field = purple_request_field_account_new("account", _("Account"), NULL); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2833 | purple_request_field_set_type_hint(field, "account"); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2834 | purple_request_field_set_visible(field, |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2835 | (purple_accounts_get_all() != NULL && |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2836 | purple_accounts_get_all()->next != NULL)); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2837 | purple_request_field_set_required(field, TRUE); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2838 | purple_request_field_group_add_field(group, field); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2839 | purple_request_field_account_set_show_all(field, TRUE); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2840 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
2841 | purple_request_fields(purple_blist_get_buddy_list(), _("View Log"), |
|
22988
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2842 | NULL, |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2843 | _("Please enter the username or alias of the person " |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2844 | "whose log you would like to view."), |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2845 | fields, |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2846 | _("OK"), G_CALLBACK(view_log_select_cb), |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2847 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
2848 | NULL, NULL); |
|
22988
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2849 | } |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2850 | |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2851 | static void |
|
23431
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2852 | view_all_logs_cb(GntMenuItem *item, gpointer n) |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2853 | { |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2854 | finch_log_show(PURPLE_LOG_IM, NULL, NULL); |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2855 | } |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2856 | |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2857 | static void |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2858 | menu_add_buddy_cb(GntMenuItem *item, gpointer null) |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2859 | { |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2860 | purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2861 | } |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2862 | |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2863 | static void |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2864 | menu_add_chat_cb(GntMenuItem *item, gpointer null) |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2865 | { |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2866 | purple_blist_request_add_chat(NULL, NULL, NULL, NULL); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2867 | } |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2868 | |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2869 | static void |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2870 | menu_add_group_cb(GntMenuItem *item, gpointer null) |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2871 | { |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2872 | purple_blist_request_add_group(); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2873 | } |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2874 | |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2875 | static void |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2876 | menu_group_set_cb(GntMenuItem *item, gpointer null) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2877 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2878 | const char *id = g_object_get_data(G_OBJECT(item), "grouping-id"); |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
2879 | purple_prefs_set_string(PREF_ROOT "/grouping", id); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2880 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2881 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2882 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21855
diff
changeset
|
2883 | create_menu(void) |
| 14774 | 2884 | { |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2885 | GntWidget *menu, *sub, *subsub; |
| 14774 | 2886 | GntMenuItem *item; |
| 2887 | GntWindow *window; | |
| 2888 | ||
| 2889 | if (!ggblist) | |
| 2890 | return; | |
| 2891 | ||
| 2892 | window = GNT_WINDOW(ggblist->window); | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2893 | ggblist->menu = menu = gnt_menu_new(GNT_MENU_TOPLEVEL); |
| 14774 | 2894 | gnt_window_set_menu(window, GNT_MENU(menu)); |
| 2895 | ||
| 2896 | item = gnt_menuitem_new(_("Options")); | |
| 2897 | gnt_menu_add_item(GNT_MENU(menu), item); | |
| 2898 | ||
| 2899 | sub = gnt_menu_new(GNT_MENU_POPUP); | |
| 2900 | gnt_menuitem_set_submenu(item, GNT_MENU(sub)); | |
| 2901 | ||
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2902 | item = gnt_menuitem_new(_("Send IM...")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2903 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "send-im"); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2904 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
2905 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL); |
|
14951
315052c54c13
[gaim-migrate @ 17661]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14945
diff
changeset
|
2906 | |
|
22378
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2907 | item = gnt_menuitem_new(_("Block/Unblock...")); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2908 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "block-unblock"); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2909 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2910 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), block_select, NULL); |
|
921097afd92d
Add a [X] Blocked item to the buddy context menu, and add a dialog to
Richard Nelson <wabz@pidgin.im>
parents:
22376
diff
changeset
|
2911 | |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2912 | item = gnt_menuitem_new(_("Join Chat...")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2913 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "join-chat"); |
|
20793
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2914 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2915 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), join_chat_select, NULL); |
|
2cf364db44c2
Add a 'Join Chat...' item in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20666
diff
changeset
|
2916 | |
|
22988
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2917 | item = gnt_menuitem_new(_("View Log...")); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2918 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-log"); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2919 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2920 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_log_cb, NULL); |
|
d311acabca71
Add a 'View log' option in the buddylist menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22986
diff
changeset
|
2921 | |
|
23431
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2922 | item = gnt_menuitem_new(_("View All Logs")); |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2923 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-all-logs"); |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2924 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2925 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_all_logs_cb, NULL); |
|
c50538da03fd
Added "View All Logs" menu in the buddylist to display a list of all IM
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23422
diff
changeset
|
2926 | |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2927 | item = gnt_menuitem_new(_("Show")); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2928 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2929 | subsub = gnt_menu_new(GNT_MENU_POPUP); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2930 | gnt_menuitem_set_submenu(item, GNT_MENU(subsub)); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2931 | |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2932 | item = gnt_menuitem_check_new(_("Empty groups")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2933 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "show-empty-groups"); |
|
18625
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2934 | gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), |
|
775baeaa9f1a
Plucked revision from im.pidgin.soc.2007.finchfeat to allow showing empty
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18614
diff
changeset
|
2935 | purple_prefs_get_bool(PREF_ROOT "/emptygroups")); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2936 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
18626
c2d9efa0ef1a
Minor changes to remove a couple of lines of duplication.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18625
diff
changeset
|
2937 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/emptygroups"); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2938 | |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2939 | item = gnt_menuitem_check_new(_("Offline buddies")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2940 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "show-offline-buddies"); |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
2941 | gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), |
| 15884 | 2942 | purple_prefs_get_bool(PREF_ROOT "/showoffline")); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2943 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
18626
c2d9efa0ef1a
Minor changes to remove a couple of lines of duplication.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18625
diff
changeset
|
2944 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/showoffline"); |
| 14774 | 2945 | |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2946 | item = gnt_menuitem_new(_("Sort")); |
| 14774 | 2947 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2948 | subsub = gnt_menu_new(GNT_MENU_POPUP); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2949 | gnt_menuitem_set_submenu(item, GNT_MENU(subsub)); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2950 | |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2951 | item = gnt_menuitem_new(_("By Status")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2952 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "sort-status"); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2953 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
2954 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "status"); |
| 14774 | 2955 | |
|
20684
4daaf3284863
propagate from branch 'im.pidgin.pidgin' (head b47c4fe72d16b3724a2e8fa0b9c783bc33863beb)
Gabriel Schulhof <nix@go-nix.ca>
diff
changeset
|
2956 | item = gnt_menuitem_new(_("Alphabetically")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2957 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "sort-alpha"); |
|
20684
4daaf3284863
propagate from branch 'im.pidgin.pidgin' (head b47c4fe72d16b3724a2e8fa0b9c783bc33863beb)
Gabriel Schulhof <nix@go-nix.ca>
diff
changeset
|
2958 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
15991
1efb6bd8ba3f
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15931
diff
changeset
|
2959 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "text"); |
| 14774 | 2960 | |
|
20691
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2961 | item = gnt_menuitem_new(_("By Log Size")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2962 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "sort-log"); |
|
20691
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2963 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2964 | gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log"); |
|
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2965 | |
|
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2966 | item = gnt_menuitem_new(_("Add")); |
| 14774 | 2967 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
20691
2b0a4e2175db
Restoring gntblist.c:create_menu
Gabriel Schulhof <nix@go-nix.ca>
parents:
20690
diff
changeset
|
2968 | |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2969 | subsub = gnt_menu_new(GNT_MENU_POPUP); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2970 | gnt_menuitem_set_submenu(item, GNT_MENU(subsub)); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2971 | |
|
22288
c6c6473ce2b9
Mark some strings for translation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22286
diff
changeset
|
2972 | item = gnt_menuitem_new(_("Buddy")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2973 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "add-buddy"); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2974 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2975 | gnt_menuitem_set_callback(item, menu_add_buddy_cb, NULL); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2976 | |
|
22288
c6c6473ce2b9
Mark some strings for translation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22286
diff
changeset
|
2977 | item = gnt_menuitem_new(_("Chat")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2978 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "add-chat"); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2979 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2980 | gnt_menuitem_set_callback(item, menu_add_chat_cb, NULL); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2981 | |
|
22288
c6c6473ce2b9
Mark some strings for translation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22286
diff
changeset
|
2982 | item = gnt_menuitem_new(_("Group")); |
|
20823
4f1e2463fc36
Add IDs to the menuitems in the buddylist menu so they can have acceletor keys.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20793
diff
changeset
|
2983 | gnt_menuitem_set_id(GNT_MENU_ITEM(item), "add-group"); |
|
20628
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2984 | gnt_menu_add_item(GNT_MENU(subsub), item); |
|
14b7b59970c3
Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
2985 | gnt_menuitem_set_callback(item, menu_add_group_cb, NULL); |
| 14774 | 2986 | |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2987 | ggblist->grouping = item = gnt_menuitem_new(_("Grouping")); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2988 | gnt_menu_add_item(GNT_MENU(sub), item); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
2989 | reconstruct_grouping_menu(); |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
2990 | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2991 | reconstruct_accounts_menu(); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2992 | gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2993 | |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2994 | reconstruct_plugins_menu(); |
|
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
2995 | gnt_menu_add_item(GNT_MENU(menu), ggblist->plugins); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2996 | } |
|
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
2997 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
2998 | void finch_blist_show() |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
2999 | { |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34716
diff
changeset
|
3000 | blist_show(purple_blist_get_buddy_list()); |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3001 | } |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
3002 | |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3003 | static void |
|
16165
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3004 | group_collapsed(GntWidget *widget, PurpleBlistNode *node, gboolean collapsed, gpointer null) |
|
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3005 | { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34657
diff
changeset
|
3006 | if (PURPLE_IS_GROUP(node)) |
| 16166 | 3007 | purple_blist_node_set_bool(node, "collapsed", collapsed); |
|
16165
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3008 | } |
|
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3009 | |
|
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3010 | static void |
| 15884 | 3011 | blist_show(PurpleBuddyList *list) |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3012 | { |
|
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3013 | if (ggblist == NULL) |
|
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3014 | new_list(list); |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18391
diff
changeset
|
3015 | else if (ggblist->window) { |
|
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18391
diff
changeset
|
3016 | gnt_window_present(ggblist->window); |
|
14909
d72792eb7575
[gaim-migrate @ 17616]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14908
diff
changeset
|
3017 | return; |
|
18400
549820f4725c
If the action-windows are already there, then bring them to front when
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18391
diff
changeset
|
3018 | } |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3019 | |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
3020 | ggblist->window = gnt_vwindow_new(FALSE); |
|
13931
a0a91e17f899
[gaim-migrate @ 16335]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13927
diff
changeset
|
3021 | gnt_widget_set_name(ggblist->window, "buddylist"); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
3022 | gnt_box_set_toplevel(GNT_BOX(ggblist->window), TRUE); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3023 | gnt_box_set_title(GNT_BOX(ggblist->window), _("Buddy List")); |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
3024 | gnt_box_set_pad(GNT_BOX(ggblist->window), 0); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3025 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3026 | ggblist->tree = gnt_tree_new(); |
| 14774 | 3027 | |
|
13915
15a38b312abe
[gaim-migrate @ 16312]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13852
diff
changeset
|
3028 | GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); |
| 15884 | 3029 | gnt_widget_set_size(ggblist->tree, purple_prefs_get_int(PREF_ROOT "/size/width"), |
| 3030 | purple_prefs_get_int(PREF_ROOT "/size/height")); | |
| 3031 | gnt_widget_set_position(ggblist->window, purple_prefs_get_int(PREF_ROOT "/position/x"), | |
| 3032 | purple_prefs_get_int(PREF_ROOT "/position/y")); | |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3033 | |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3034 | gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3035 | |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3036 | ggblist->status = gnt_combo_box_new(); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3037 | gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->status); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3038 | ggblist->statustext = gnt_entry_new(NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3039 | gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->statustext); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3040 | |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3041 | gnt_widget_show(ggblist->window); |
|
13926
d2c1522276b3
[gaim-migrate @ 16328]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13923
diff
changeset
|
3042 | |
| 15884 | 3043 | purple_signal_connect(purple_connections_get_handle(), "signed-on", finch_blist_get_handle(), |
| 3044 | PURPLE_CALLBACK(reconstruct_accounts_menu), NULL); | |
| 3045 | purple_signal_connect(purple_connections_get_handle(), "signed-off", finch_blist_get_handle(), | |
| 3046 | PURPLE_CALLBACK(reconstruct_accounts_menu), NULL); | |
|
26871
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26852
diff
changeset
|
3047 | purple_signal_connect(purple_accounts_get_handle(), "account-actions-changed", finch_blist_get_handle(), |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26852
diff
changeset
|
3048 | PURPLE_CALLBACK(reconstruct_accounts_menu), NULL); |
| 15884 | 3049 | purple_signal_connect(purple_blist_get_handle(), "buddy-status-changed", finch_blist_get_handle(), |
| 3050 | PURPLE_CALLBACK(buddy_status_changed), ggblist); | |
| 3051 | purple_signal_connect(purple_blist_get_handle(), "buddy-idle-changed", finch_blist_get_handle(), | |
| 3052 | PURPLE_CALLBACK(buddy_idle_changed), ggblist); | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3053 | |
| 15884 | 3054 | purple_signal_connect(purple_plugins_get_handle(), "plugin-load", finch_blist_get_handle(), |
| 3055 | PURPLE_CALLBACK(reconstruct_plugins_menu), NULL); | |
| 3056 | purple_signal_connect(purple_plugins_get_handle(), "plugin-unload", finch_blist_get_handle(), | |
| 3057 | PURPLE_CALLBACK(reconstruct_plugins_menu), NULL); | |
|
14945
4cd7dbf2933b
[gaim-migrate @ 17652]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14912
diff
changeset
|
3058 | |
|
22110
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
3059 | purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", finch_blist_get_handle(), |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
3060 | PURPLE_CALLBACK(buddy_signed_on_off), ggblist); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
3061 | purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", finch_blist_get_handle(), |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
3062 | PURPLE_CALLBACK(buddy_signed_on_off), ggblist); |
|
d0bd9cd65d03
Blink the buddies that signed on/off recently for six seconds.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21855
diff
changeset
|
3063 | |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
3064 | g_signal_connect(G_OBJECT(ggblist->tree), "selection_changed", G_CALLBACK(selection_changed), ggblist); |
|
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
3065 | g_signal_connect(G_OBJECT(ggblist->tree), "key_pressed", G_CALLBACK(key_pressed), ggblist); |
|
14896
bcc0f594ed15
[gaim-migrate @ 17601]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14774
diff
changeset
|
3066 | g_signal_connect(G_OBJECT(ggblist->tree), "context-menu", G_CALLBACK(context_menu), ggblist); |
|
16165
24ec117bc52c
Remember the collapsed state of groups in the blist
Richard Nelson <wabz@pidgin.im>
parents:
15991
diff
changeset
|
3067 | g_signal_connect(G_OBJECT(ggblist->tree), "collapse-toggled", G_CALLBACK(group_collapsed), NULL); |
|
13922
7195a6fe2416
[gaim-migrate @ 16321]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13920
diff
changeset
|
3068 | g_signal_connect(G_OBJECT(ggblist->tree), "activate", G_CALLBACK(selection_activate), ggblist); |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3069 | g_signal_connect_data(G_OBJECT(ggblist->tree), "gained-focus", G_CALLBACK(draw_tooltip), |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3070 | ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED); |
|
14020
d9a007b109be
[gaim-migrate @ 16510]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
3071 | g_signal_connect_data(G_OBJECT(ggblist->tree), "lost-focus", G_CALLBACK(remove_peripherals), |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3072 | ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED); |
|
16779
006f50afb7a6
Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents:
16719
diff
changeset
|
3073 | g_signal_connect_data(G_OBJECT(ggblist->window), "workspace-hidden", G_CALLBACK(remove_peripherals), |
|
006f50afb7a6
Let windows know when the workspace they are in is being hidden/shown
Richard Nelson <wabz@pidgin.im>
parents:
16719
diff
changeset
|
3074 | ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED); |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
3075 | g_signal_connect(G_OBJECT(ggblist->tree), "size_changed", G_CALLBACK(size_changed_cb), NULL); |
|
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
3076 | g_signal_connect(G_OBJECT(ggblist->window), "position_set", G_CALLBACK(save_position_cb), NULL); |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
3077 | g_signal_connect(G_OBJECT(ggblist->window), "destroy", G_CALLBACK(reset_blist_window), NULL); |
|
14072
4e64a4f18686
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
3078 | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3079 | /* Status signals */ |
| 15884 | 3080 | purple_signal_connect(purple_savedstatuses_get_handle(), "savedstatus-changed", finch_blist_get_handle(), |
| 3081 | PURPLE_CALLBACK(savedstatus_changed), NULL); | |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3082 | g_signal_connect(G_OBJECT(ggblist->status), "selection_changed", |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3083 | G_CALLBACK(status_selection_changed), NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3084 | g_signal_connect(G_OBJECT(ggblist->statustext), "key_pressed", |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3085 | G_CALLBACK(status_text_changed), NULL); |
|
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3086 | |
| 14774 | 3087 | create_menu(); |
|
14678
97f57691faab
[gaim-migrate @ 17344]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14620
diff
changeset
|
3088 | |
|
14086
732c14687955
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14082
diff
changeset
|
3089 | populate_buddylist(); |
|
14103
bcac61d40461
[gaim-migrate @ 16647]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14086
diff
changeset
|
3090 | |
| 15884 | 3091 | savedstatus_changed(purple_savedstatus_get_current(), NULL); |
|
13852
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3092 | } |
|
1d3ae9f34d42
[gaim-migrate @ 16308]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3093 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
3094 | void finch_blist_uninit() |
|
13969
0541f389442e
[gaim-migrate @ 16402]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13959
diff
changeset
|
3095 | { |
|
0541f389442e
[gaim-migrate @ 16402]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13959
diff
changeset
|
3096 | } |
|
0541f389442e
[gaim-migrate @ 16402]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13959
diff
changeset
|
3097 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
3098 | gboolean finch_blist_get_position(int *x, int *y) |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3099 | { |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3100 | if (!ggblist || !ggblist->window) |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3101 | return FALSE; |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3102 | gnt_widget_get_position(ggblist->window, x, y); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3103 | return TRUE; |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3104 | } |
|
13969
0541f389442e
[gaim-migrate @ 16402]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13959
diff
changeset
|
3105 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
3106 | void finch_blist_set_position(int x, int y) |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3107 | { |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3108 | gnt_widget_set_position(ggblist->window, x, y); |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3109 | } |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3110 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
3111 | gboolean finch_blist_get_size(int *width, int *height) |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3112 | { |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3113 | if (!ggblist || !ggblist->window) |
|
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3114 | return FALSE; |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3115 | gnt_widget_get_size(ggblist->window, width, height); |
|
14413
bd998fe17d82
[gaim-migrate @ 17054]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14280
diff
changeset
|
3116 | return TRUE; |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3117 | } |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3118 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15825
diff
changeset
|
3119 | void finch_blist_set_size(int width, int height) |
|
13978
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3120 | { |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3121 | gnt_widget_set_size(ggblist->window, width, height); |
|
70d7030b7f26
[gaim-migrate @ 16418]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13969
diff
changeset
|
3122 | } |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3123 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3124 | void finch_blist_install_manager(const FinchBlistManager *manager) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3125 | { |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3126 | if (!g_list_find(managers, manager)) { |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3127 | managers = g_list_append(managers, (gpointer)manager); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3128 | reconstruct_grouping_menu(); |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
3129 | if (purple_strequal(manager->id, purple_prefs_get_string(PREF_ROOT "/grouping"))) |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
3130 | purple_prefs_trigger_callback(PREF_ROOT "/grouping"); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3131 | } |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3132 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3133 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3134 | void finch_blist_uninstall_manager(const FinchBlistManager *manager) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3135 | { |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3136 | if (g_list_find(managers, manager)) { |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3137 | managers = g_list_remove(managers, manager); |
|
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3138 | reconstruct_grouping_menu(); |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
3139 | if (purple_strequal(manager->id, purple_prefs_get_string(PREF_ROOT "/grouping"))) |
|
22300
42f7d98ffeeb
Remember the selected grouping option.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22299
diff
changeset
|
3140 | purple_prefs_trigger_callback(PREF_ROOT "/grouping"); |
|
22299
e2e241477323
Reconstruct the 'Grouping' menu when a blist manager is un/installed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22288
diff
changeset
|
3141 | } |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3142 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3143 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3144 | FinchBlistManager * finch_blist_manager_find(const char *id) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3145 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3146 | GList *iter = managers; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3147 | if (!id) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3148 | return NULL; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3149 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3150 | for (; iter; iter = iter->next) { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3151 | FinchBlistManager *m = iter->data; |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
31601
diff
changeset
|
3152 | if (purple_strequal(id, m->id)) |
|
22285
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3153 | return m; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3154 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3155 | return NULL; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3156 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3157 | |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3158 | GntTree * finch_blist_get_tree(void) |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3159 | { |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3160 | return ggblist ? GNT_TREE(ggblist->tree) : NULL; |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3161 | } |
|
203b8d12f1ca
Add a buddy list manager for finch. This allows plugins to show the buddylist
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22282
diff
changeset
|
3162 | |
| 35587 | 3163 | /************************************************************************** |
| 3164 | * GBoxed code | |
| 3165 | **************************************************************************/ | |
| 3166 | static FinchBlistManager * | |
| 3167 | finch_blist_manager_copy(FinchBlistManager *manager) | |
| 3168 | { | |
| 3169 | FinchBlistManager *manager_new; | |
| 3170 | ||
| 3171 | g_return_val_if_fail(manager != NULL, NULL); | |
| 3172 | ||
| 3173 | manager_new = g_new(FinchBlistManager, 1); | |
| 3174 | *manager_new = *manager; | |
| 3175 | ||
| 3176 | return manager_new; | |
| 3177 | } | |
| 3178 | ||
| 3179 | static void | |
| 3180 | finch_blist_manager_free(FinchBlistManager *manager) | |
| 3181 | { | |
| 3182 | g_return_if_fail(manager != NULL); | |
| 3183 | ||
| 3184 | g_free(manager); | |
| 3185 | } | |
| 3186 | ||
| 3187 | GType | |
| 3188 | finch_blist_manager_get_type(void) | |
| 3189 | { | |
| 3190 | static GType type = 0; | |
| 3191 | ||
| 3192 | if (type == 0) { | |
| 3193 | type = g_boxed_type_register_static("FinchBlistManager", | |
| 3194 | (GBoxedCopyFunc)finch_blist_manager_copy, | |
| 3195 | (GBoxedFreeFunc)finch_blist_manager_free); | |
| 3196 | } | |
| 3197 | ||
| 3198 | return type; | |
| 3199 | } |