Sun, 23 May 2004 22:17:38 +0000
[gaim-migrate @ 9821]
nosnilmot wrote:
" This patch prevents turning strings with '@' in them
into mailto: links if they are not valid email addresses.
An example would be copying from a shell something like:
[user@host dir]$ thing
would create a mailto link to "[user@host"
It adds a gaim_email_is_valid function to util.c which
could also be used elsewhere :)
Thanks to Alver on #gaim for reporting this buglet."
And also said:
"Updated patch attached, tested against 86,171 valid email
addresses and as many invalid addresses as I could make up"
committer: Tim Ringenbach <marv@pidgin.im>
| 1 | 1 | /* |
| 2 | * gaim | |
| 3 | * | |
| 8046 | 4 | * Gaim is the legal property of its developers, whose names are too numerous |
| 5 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 6 | * source distribution. | |
| 1 | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | * | |
| 22 | */ | |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6321
diff
changeset
|
23 | #include "gtkinternal.h" |
| 3630 | 24 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
25 | #include "account.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
26 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
27 | #include "log.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
28 | #include "notify.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
29 | #include "pounce.h" |
| 5442 | 30 | #include "prefs.h" |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
31 | #include "proxy.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
32 | #include "prpl.h" |
| 4561 | 33 | #include "sound.h" |
|
6101
c3762fa398c4
[gaim-migrate @ 6560]
Mark Doliner <markdoliner@pidgin.im>
parents:
6098
diff
changeset
|
34 | #include "status.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
35 | #include "ui.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
36 | #include "util.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
37 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
38 | #include "gaim.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
39 | |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
40 | #include "gtkpounce.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5868
diff
changeset
|
41 | #include "gtksound.h" |
| 6144 | 42 | #include "gtkplugin.h" |
|
6372
27c3152351ce
[gaim-migrate @ 6877]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
43 | #include "gtkutils.h" |
| 3630 | 44 | |
|
230
5afbb3468f11
[gaim-migrate @ 240]
Todd Kulesza <fflewddur@users.sourceforge.net>
parents:
180
diff
changeset
|
45 | /* for people like myself, who are too lazy to add an away msg :) */ |
|
4596
64e72bf4ece4
[gaim-migrate @ 4881]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
4592
diff
changeset
|
46 | #define BORING_DEFAULT_AWAY_MSG _("sorry, i ran out for a while. bbl") |
| 1139 | 47 | #define MAX_VALUES 10 |
| 1 | 48 | |
| 9025 | 49 | /* We're going to ignore strikethough and assume "custom font" |
| 50 | means to send custom formatting */ | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
51 | #define OPT_FONT_BOLD 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
52 | #define OPT_FONT_ITALIC 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
53 | #define OPT_FONT_UNDERLINE 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
54 | #define OPT_FONT_FACE 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
55 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
56 | #define OPT_MISC_DEBUG 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
57 | #define OPT_MISC_BROWSER_POPUP 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
58 | #define OPT_MISC_BUDDY_TICKER 0x00000004 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
59 | #define OPT_MISC_STEALTH_TYPING 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
60 | #define OPT_MISC_USE_SERVER_ALIAS 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
61 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
62 | #define OPT_LOG_CONVOS 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
63 | #define OPT_LOG_STRIP_HTML 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
64 | #define OPT_LOG_INDIVIDUAL 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
65 | #define OPT_LOG_CHATS 0x00000100 |
| 7431 | 66 | #define OPT_LOG_BUDDY_SIGNON 0x00000004 |
| 67 | #define OPT_LOG_BUDDY_IDLE 0x00000008 | |
| 68 | #define OPT_LOG_BUDDY_AWAY 0x00000010 | |
| 69 | #define OPT_LOG_MY_SIGNON 0x00000020 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
70 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
71 | #define OPT_BLIST_SHOW_GRPNUM 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
72 | #define OPT_BLIST_SHOW_PIXMAPS 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
73 | #define OPT_BLIST_SHOW_IDLETIME 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
74 | #define OPT_BLIST_SHOW_BUTTON_XPM 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
75 | #define OPT_BLIST_NO_BUTTON_TEXT 0x00000080 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
76 | #define OPT_BLIST_NO_MT_GRP 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
77 | #define OPT_BLIST_SHOW_WARN 0x00000200 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
78 | #define OPT_BLIST_GREY_IDLERS 0x00000400 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
79 | #define OPT_BLIST_POPUP 0x00001000 |
| 5633 | 80 | #define OPT_BLIST_SHOW_ICONS 0x00002000 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
81 | #define OPT_BLIST_SHOW_OFFLINE 0x00004000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
82 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
83 | #define OPT_CONVO_ENTER_SENDS 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
84 | #define OPT_CONVO_SEND_LINKS 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
85 | #define OPT_CONVO_CHECK_SPELLING 0x00000004 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
86 | #define OPT_CONVO_CTL_CHARS 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
87 | #define OPT_CONVO_CTL_SMILEYS 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
88 | #define OPT_CONVO_ESC_CAN_CLOSE 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
89 | #define OPT_CONVO_CTL_ENTER 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
90 | #define OPT_CONVO_F2_TOGGLES 0x00000080 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
91 | #define OPT_CONVO_SHOW_TIME 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
92 | #define OPT_CONVO_IGNORE_COLOUR 0x00000200 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
93 | #define OPT_CONVO_SHOW_SMILEY 0x00000400 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
94 | #define OPT_CONVO_IGNORE_FONTS 0x00000800 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
95 | #define OPT_CONVO_IGNORE_SIZES 0x00001000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
96 | #define OPT_CONVO_COMBINE 0x00002000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
97 | #define OPT_CONVO_CTL_W_CLOSES 0x00004000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
98 | #define OPT_CONVO_NO_X_ON_TAB 0x00008000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
99 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
100 | #define OPT_IM_POPUP 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
101 | #define OPT_IM_LOGON 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
102 | #define OPT_IM_BUTTON_TEXT 0x00000004 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
103 | #define OPT_IM_BUTTON_XPM 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
104 | #define OPT_IM_ONE_WINDOW 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
105 | #define OPT_IM_SIDE_TAB 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
106 | #define OPT_IM_BR_TAB 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
107 | #define OPT_IM_HIDE_ICONS 0x00000080 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
108 | #define OPT_IM_NO_ANIMATION 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
109 | #define OPT_IM_ALIAS_TAB 0x00002000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
110 | #define OPT_IM_POPDOWN 0x00004000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
111 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
112 | #define OPT_CHAT_ONE_WINDOW 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
113 | #define OPT_CHAT_BUTTON_TEXT 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
114 | #define OPT_CHAT_BUTTON_XPM 0x00000004 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
115 | #define OPT_CHAT_LOGON 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
116 | #define OPT_CHAT_POPUP 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
117 | #define OPT_CHAT_SIDE_TAB 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
118 | #define OPT_CHAT_BR_TAB 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
119 | #define OPT_CHAT_OLD_STYLE_TAB 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
120 | #define OPT_CHAT_COLORIZE 0x00000200 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
121 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
122 | #define OPT_SOUND_LOGIN 0x00000001 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
123 | #define OPT_SOUND_LOGOUT 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
124 | #define OPT_SOUND_RECV 0x00000004 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
125 | #define OPT_SOUND_SEND 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
126 | #define OPT_SOUND_FIRST_RCV 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
127 | #define OPT_SOUND_WHEN_AWAY 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
128 | #define OPT_SOUND_SILENT_SIGNON 0x00000040 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
129 | #define OPT_SOUND_THROUGH_GNOME 0x00000080 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
130 | #define OPT_SOUND_CHAT_JOIN 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
131 | #define OPT_SOUND_CHAT_SAY 0x00000200 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
132 | #define OPT_SOUND_BEEP 0x00000400 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
133 | #define OPT_SOUND_CHAT_PART 0x00000800 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
134 | #define OPT_SOUND_CHAT_YOU_SAY 0x00001000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
135 | #define OPT_SOUND_NORMAL 0x00002000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
136 | #define OPT_SOUND_NAS 0x00004000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
137 | #define OPT_SOUND_ARTS 0x00008000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
138 | #define OPT_SOUND_ESD 0x00010000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
139 | #define OPT_SOUND_CMD 0x00020000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
140 | #define OPT_SOUND_CHAT_NICK 0x00040000 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
141 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
142 | #define OPT_AWAY_BACK_ON_IM 0x00000002 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
143 | #define OPT_AWAY_AUTO 0x00000008 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
144 | #define OPT_AWAY_NO_AUTO_RESP 0x00000010 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
145 | #define OPT_AWAY_QUEUE 0x00000020 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
146 | #define OPT_AWAY_IDLE_RESP 0x00000040 |
|
5554
a197dfd0d8b3
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
147 | #define OPT_AWAY_QUEUE_UNREAD 0x00000080 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
148 | #define OPT_AWAY_DELAY_IN_USE 0x00000100 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
149 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
150 | #define OPT_ACCT_AUTO 0x00000001 |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
151 | /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */ |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
152 | #define OPT_ACCT_REM_PASS 0x00000004 |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
153 | #define OPT_ACCT_MAIL_CHECK 0x00000008 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
154 | |
| 5631 | 155 | #define IDLE_NONE 0 |
| 156 | #define IDLE_GAIM 1 | |
| 157 | #define IDLE_SCREENSAVER 2 | |
| 158 | ||
| 5633 | 159 | #define BROWSER_NETSCAPE 0 |
| 160 | #define BROWSER_KONQ 1 | |
| 161 | #define BROWSER_MANUAL 2 | |
| 162 | /*#define BROWSER_INTERNAL 3*/ | |
| 163 | #define BROWSER_GNOME 4 | |
| 164 | #define BROWSER_OPERA 5 | |
| 165 | #define BROWSER_GALEON 6 | |
| 166 | #define BROWSER_MOZILLA 7 | |
| 167 | ||
| 168 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
169 | static guint misc_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
170 | static guint logging_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
171 | static guint blist_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
172 | static guint convo_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
173 | static guint im_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
174 | static guint chat_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
175 | static guint font_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
176 | static guint sound_options; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
177 | static guint away_options; |
| 4137 | 178 | static guint is_loading_prefs = 0; |
| 179 | static guint request_save_prefs = 0; | |
| 180 | static guint is_saving_prefs = 0; | |
| 181 | static guint request_load_prefs = 0; | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
182 | static guint prefs_initial_load = 0; |
| 4137 | 183 | guint proxy_info_is_from_gaimrc = 1; /* Only save proxy info if it |
| 184 | * was loaded from the file | |
| 185 | * or otherwise explicitly requested */ | |
| 1 | 186 | |
| 187 | struct parse { | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
188 | char option[256]; |
|
2286
bc6384ba314a
[gaim-migrate @ 2296]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2199
diff
changeset
|
189 | char value[MAX_VALUES][4096]; |
| 1 | 190 | }; |
| 191 | ||
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
192 | /* |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
193 | * This is absolutely necessary, unfortunately. It is used to grab |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
194 | * the information on the pounce, so that we can then later register |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
195 | * them. The reason we do this (well, one of them) is because the buddy |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
196 | * list isn't processed yet. |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
197 | * |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
198 | * -- ChipX86 |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
199 | */ |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
200 | struct pounce_placeholder |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
201 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
202 | char name[80]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
203 | char message[2048]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
204 | char command[2048]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
205 | char sound[2048]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
206 | char pouncer[80]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
207 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
208 | int protocol; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
209 | int options; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
210 | }; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
211 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
212 | static GList *buddy_pounces = NULL; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
213 | |
| 3493 | 214 | static struct parse *parse_line(char *line, struct parse *p) |
| 1 | 215 | { |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
216 | char *c = line; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
217 | int inopt = 1, inval = 0, curval = -1; |
| 4137 | 218 | int optlen = 0, vallen = 0, last_non_space = 0; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
219 | int x; |
| 1 | 220 | |
| 1137 | 221 | for (x = 0; x < MAX_VALUES; x++) { |
| 3493 | 222 | p->value[x][0] = 0; |
| 1137 | 223 | } |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
224 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
225 | while (*c) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
226 | if (*c == '\t') { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
227 | c++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
228 | continue; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
229 | } |
| 5633 | 230 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
231 | if (inopt) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
232 | if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
233 | inopt = 0; |
| 3493 | 234 | p->option[optlen] = 0; |
| 1 | 235 | c++; |
| 236 | continue; | |
| 237 | } | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
238 | |
| 3493 | 239 | p->option[optlen] = *c; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
240 | optlen++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
241 | c++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
242 | continue; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
243 | } else if (inval) { |
| 4049 | 244 | if (*c == '\\') { |
| 245 | /* if we have a \ take the char after it literally.. */ | |
| 246 | c++; | |
| 247 | p->value[curval][vallen] = *c; | |
| 248 | ||
| 249 | vallen++; | |
| 4137 | 250 | last_non_space = vallen; |
| 4049 | 251 | c++; |
| 252 | continue; | |
| 253 | } else if (*c == '}') { | |
| 254 | /* } that isn't escaped should end this chunk of data, and | |
| 255 | * should have a space before it.. */ | |
| 4137 | 256 | p->value[curval][last_non_space] = 0; |
| 4049 | 257 | inval = 0; |
| 258 | c++; | |
| 259 | continue; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
260 | } else { |
| 3493 | 261 | p->value[curval][vallen] = *c; |
| 4049 | 262 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
263 | vallen++; |
|
5109
2dccb0867a8b
[gaim-migrate @ 5472]
Mark Doliner <markdoliner@pidgin.im>
parents:
5108
diff
changeset
|
264 | if (isspace(*c)) |
|
2dccb0867a8b
[gaim-migrate @ 5472]
Mark Doliner <markdoliner@pidgin.im>
parents:
5108
diff
changeset
|
265 | last_non_space = vallen - 1; |
|
2dccb0867a8b
[gaim-migrate @ 5472]
Mark Doliner <markdoliner@pidgin.im>
parents:
5108
diff
changeset
|
266 | else |
| 4137 | 267 | last_non_space = vallen; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
268 | c++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
269 | continue; |
| 1 | 270 | } |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
271 | } else if (*c == '{') { |
| 4049 | 272 | /* i really don't think this if ever succeeds, but i'm |
| 273 | * not brave enough to take it out... */ | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
274 | if (*(c - 1) == '\\') { |
| 4137 | 275 | p->value[curval][vallen] = *c; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
276 | c++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
277 | continue; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
278 | } else { |
| 4049 | 279 | /* { that isn't escaped should signify the start of a |
| 280 | * piece of data and should have a space after it.. */ | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
281 | curval++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
282 | vallen = 0; |
| 4137 | 283 | last_non_space = vallen; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
284 | inval = 1; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
285 | c++; |
| 4137 | 286 | while (*c && isspace(*c)) |
| 287 | c++; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
288 | continue; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
289 | } |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
290 | } |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
291 | c++; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
292 | } |
| 1137 | 293 | |
| 3493 | 294 | return p; |
| 1 | 295 | } |
| 296 | ||
| 297 | ||
| 298 | static int gaimrc_parse_tag(FILE *f) | |
| 299 | { | |
| 300 | char buf[2048]; | |
| 301 | char tag[256]; | |
| 302 | buf[0] = '#'; | |
| 303 | ||
| 304 | while (buf[0] == '#' && !feof(f)) | |
| 305 | fgets(buf, sizeof(buf), f); | |
| 306 | ||
| 307 | if (feof(f)) | |
| 308 | return -1; | |
| 309 | ||
|
5514
19d19a5ddaff
[gaim-migrate @ 5913]
Mark Doliner <markdoliner@pidgin.im>
parents:
5442
diff
changeset
|
310 | if (sscanf(buf, "%s {", tag) != 1) |
|
19d19a5ddaff
[gaim-migrate @ 5913]
Mark Doliner <markdoliner@pidgin.im>
parents:
5442
diff
changeset
|
311 | return -1; |
| 1 | 312 | |
| 313 | if (!strcmp(tag, "users")) { | |
| 314 | return 0; | |
| 315 | } else if (!strcmp(tag, "options")) { | |
| 316 | return 1; | |
| 317 | } else if (!strcmp(tag, "away")) { | |
| 318 | return 2; | |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
319 | } else if (!strcmp(tag, "plugins")) { |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
320 | return 3; |
| 673 | 321 | } else if (!strcmp(tag, "pounce")) { |
| 322 | return 4; | |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
323 | } else if (!strcmp(tag, "sound_files")) { |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
324 | return 6; |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
325 | } else if (!strcmp(tag, "proxy")) { |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
326 | return 7; |
|
4026
4ec5559caae9
[gaim-migrate @ 4230]
Herman Bloggs <herman@bluedigits.com>
parents:
3924
diff
changeset
|
327 | } else if (!strcmp(tag, "wgaim")) { |
|
4ec5559caae9
[gaim-migrate @ 4230]
Herman Bloggs <herman@bluedigits.com>
parents:
3924
diff
changeset
|
328 | return 8; |
| 1 | 329 | } |
| 330 | return -1; | |
| 331 | } | |
| 332 | ||
| 333 | static void gaimrc_read_away(FILE *f) | |
| 334 | { | |
| 3493 | 335 | struct parse parse_buffer; |
| 1 | 336 | struct parse *p; |
| 337 | char buf[4096]; | |
| 338 | struct away_message *a; | |
| 339 | ||
| 340 | buf[0] = 0; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
341 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
342 | while (buf[0] != '}') { |
| 1 | 343 | if (!fgets(buf, sizeof(buf), f)) |
| 344 | return; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
345 | |
| 6065 | 346 | if (buf[0] == '}') { |
| 347 | gaim_status_sync(); | |
| 1 | 348 | return; |
| 6065 | 349 | } |
| 1 | 350 | |
| 3493 | 351 | p = parse_line(buf, &parse_buffer); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
352 | if (!strcmp(p->option, "message")) { |
| 15 | 353 | a = g_new0(struct away_message, 1); |
| 1 | 354 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
355 | g_snprintf(a->name, sizeof(a->name), "%s", p->value[0]); |
| 15 | 356 | g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]); |
| 1209 | 357 | away_messages = g_slist_insert_sorted(away_messages, a, sort_awaymsg_list); |
| 15 | 358 | } |
| 1109 | 359 | /* auto { time } { default message } */ |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
360 | else if (!strcmp(p->option, "auto")) { |
| 6216 | 361 | struct away_message *default_away; |
| 5748 | 362 | gaim_prefs_set_int("/core/away/mins_before_away", |
| 363 | atoi(p->value[0])); | |
|
2372
c24942700dfd
[gaim-migrate @ 2385]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2369
diff
changeset
|
364 | default_away = g_slist_nth_data(away_messages, atoi(p->value[1])); |
| 6223 | 365 | if (default_away) |
| 366 | gaim_prefs_set_string("/core/away/default_message", | |
| 367 | default_away->name); | |
| 1109 | 368 | } |
| 1 | 369 | } |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
370 | if (!away_messages) { |
|
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
371 | a = g_new0(struct away_message, 1); |
|
4589
e6d7d19da849
[gaim-migrate @ 4873]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
4581
diff
changeset
|
372 | g_snprintf(a->name, sizeof(a->name), _("boring default")); |
|
6321
0b54b2a172d1
[gaim-migrate @ 6820]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
6223
diff
changeset
|
373 | g_snprintf(a->message, sizeof(a->message), "%s", _(BORING_DEFAULT_AWAY_MSG)); |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
374 | away_messages = g_slist_append(away_messages, a); |
|
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
375 | } |
| 6065 | 376 | gaim_status_sync(); |
| 1 | 377 | } |
| 378 | ||
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
379 | /* |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
380 | * This is temporary, and we're using it to translate the new event |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
381 | * and action values into the old ones. We're also adding entries for |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
382 | * new types, but if you go and use an older gaim, these will be nuked. |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
383 | * When we have a better prefs system, this can go away. |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
384 | * |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
385 | * -- ChipX86 |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
386 | */ |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
387 | typedef enum |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
388 | { |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
389 | GAIM_GTKPOUNCE_NONE = 0x00, /**< No action. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
390 | GAIM_GTKPOUNCE_OPEN_WIN = 0x01, /**< Open an IM window. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
391 | GAIM_GTKPOUNCE_POPUP = 0x02, /**< Popup notification. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
392 | GAIM_GTKPOUNCE_SEND_MSG = 0x04, /**< Send a message. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
393 | GAIM_GTKPOUNCE_EXEC_CMD = 0x08, /**< Execute a command. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
394 | GAIM_GTKPOUNCE_PLAY_SOUND = 0x10 /**< Play a sound. */ |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
395 | |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
396 | } GaimGtkPounceAction; |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
397 | |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
398 | static int pounce_evt_trans_table[] = |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
399 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
400 | 0x010, GAIM_POUNCE_SIGNON, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
401 | 0x020, GAIM_POUNCE_AWAY_RETURN, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
402 | 0x040, GAIM_POUNCE_IDLE_RETURN, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
403 | 0x080, GAIM_POUNCE_TYPING, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
404 | /* 0x100, save, is handled separately. */ |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
405 | 0x400, GAIM_POUNCE_SIGNOFF, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
406 | 0x800, GAIM_POUNCE_AWAY, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
407 | 0x1000, GAIM_POUNCE_IDLE, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
408 | 0x2000, GAIM_POUNCE_TYPING_STOPPED |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
409 | }; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
410 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
411 | static int pounce_act_trans_table[] = |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
412 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
413 | 0x001, GAIM_GTKPOUNCE_OPEN_WIN, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
414 | 0x002, GAIM_GTKPOUNCE_SEND_MSG, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
415 | 0x004, GAIM_GTKPOUNCE_EXEC_CMD, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
416 | 0x008, GAIM_GTKPOUNCE_PLAY_SOUND, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
417 | /* 0x100, save, is handled separately. */ |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
418 | 0x200, GAIM_GTKPOUNCE_POPUP |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
419 | }; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
420 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
421 | static int pounce_evt_trans_table_size = |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
422 | (sizeof(pounce_evt_trans_table) / sizeof(*pounce_evt_trans_table)); |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
423 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
424 | static int pounce_act_trans_table_size = |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
425 | (sizeof(pounce_act_trans_table) / sizeof(*pounce_act_trans_table)); |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
426 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
427 | static void |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
428 | old_pounce_opts_to_new(int opts, GaimPounceEvent *events, |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
429 | GaimGtkPounceAction *actions) |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
430 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
431 | int i; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
432 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
433 | *events = 0; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
434 | *actions = 0; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
435 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
436 | /* First, convert events */ |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
437 | for (i = 0; i < pounce_evt_trans_table_size; i += 2) |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
438 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
439 | int evt = pounce_evt_trans_table[i]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
440 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
441 | if ((opts & evt) == evt) |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
442 | *events |= pounce_evt_trans_table[i + 1]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
443 | } |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
444 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
445 | for (i = 0; i < pounce_act_trans_table_size; i += 2) |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
446 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
447 | int act = pounce_act_trans_table[i]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
448 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
449 | if ((opts & act) == act) |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
450 | *actions |= pounce_act_trans_table[i + 1]; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
451 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
452 | } |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
453 | } |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
454 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
455 | static void |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
456 | gaimrc_read_pounce(FILE *f) |
| 673 | 457 | { |
| 3493 | 458 | struct parse parse_buffer; |
| 673 | 459 | struct parse *p; |
| 460 | char buf[4096]; | |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
461 | struct pounce_placeholder *b; |
| 673 | 462 | |
| 463 | buf[0] = 0; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
464 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
465 | while (buf[0] != '}') { |
| 673 | 466 | if (!fgets(buf, sizeof(buf), f)) |
| 467 | return; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
468 | |
| 673 | 469 | if (buf[0] == '}') |
| 470 | return; | |
| 471 | ||
| 3493 | 472 | p = parse_line(buf, &parse_buffer); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
473 | if (!strcmp(p->option, "entry")) { |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
474 | b = g_new0(struct pounce_placeholder, 1); |
| 673 | 475 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
476 | g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]); |
| 1155 | 477 | g_snprintf(b->message, sizeof(b->message), "%s", p->value[1]); |
|
1229
4d9315989885
[gaim-migrate @ 1239]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1214
diff
changeset
|
478 | g_snprintf(b->command, sizeof(b->command), "%s", p->value[2]); |
| 673 | 479 | |
|
1235
c8d6eef4edce
[gaim-migrate @ 1245]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1229
diff
changeset
|
480 | b->options = atoi(p->value[3]); |
| 1137 | 481 | |
|
1235
c8d6eef4edce
[gaim-migrate @ 1245]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1229
diff
changeset
|
482 | g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[4]); |
|
c8d6eef4edce
[gaim-migrate @ 1245]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1229
diff
changeset
|
483 | b->protocol = atoi(p->value[5]); |
| 1137 | 484 | |
| 1694 | 485 | g_snprintf(b->sound, sizeof(b->sound), "%s", p->value[6]); |
|
2372
c24942700dfd
[gaim-migrate @ 2385]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2369
diff
changeset
|
486 | |
| 673 | 487 | buddy_pounces = g_list_append(buddy_pounces, b); |
| 488 | } | |
| 489 | } | |
| 490 | } | |
| 491 | ||
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
492 | static void gaimrc_read_plugins(FILE *f) |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
493 | { |
| 3493 | 494 | struct parse parse_buffer; |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
495 | struct parse *p; |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
496 | char buf[4096]; |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
497 | |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
498 | buf[0] = 0; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
499 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
500 | while (buf[0] != '}') { |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
501 | if (!fgets(buf, sizeof(buf), f)) |
|
1236
59d129db22b4
[gaim-migrate @ 1246]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1235
diff
changeset
|
502 | break; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
503 | |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
504 | if (buf[0] == '}') |
|
1236
59d129db22b4
[gaim-migrate @ 1246]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1235
diff
changeset
|
505 | break; |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
506 | |
| 3493 | 507 | p = parse_line(buf, &parse_buffer); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
508 | if (!strcmp(p->option, "plugin")) { |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
509 | gaim_plugin_load(gaim_plugin_probe(p->value[0])); |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
510 | } |
|
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
511 | } |
| 6144 | 512 | gaim_gtk_plugins_save(); |
|
142
fc9c79676b08
[gaim-migrate @ 152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
131
diff
changeset
|
513 | } |
| 1 | 514 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
515 | static GaimAccount *gaimrc_read_user(FILE *f) |
| 1 | 516 | { |
| 3493 | 517 | struct parse parse_buffer; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
518 | struct parse *p; |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
519 | GaimAccount *account; |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
520 | int i; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
521 | char buf[4096]; |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
522 | char user_info[2048]; |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
523 | int flags; |
| 5618 | 524 | char *tmp; |
| 1 | 525 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
526 | if (!fgets(buf, sizeof(buf), f)) |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
527 | return NULL; |
| 1 | 528 | |
| 3493 | 529 | p = parse_line(buf, &parse_buffer); |
| 1 | 530 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
531 | if (strcmp(p->option, "ident")) |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
532 | return NULL; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
533 | |
| 6067 | 534 | account = gaim_account_new(p->value[0], NULL); |
| 1 | 535 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
536 | gaim_account_set_password(account, p->value[1]); |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
537 | gaim_account_set_remember_password(account, TRUE); |
| 1 | 538 | |
|
5710
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5691
diff
changeset
|
539 | gaim_accounts_add(account); |
|
3c2bf5725bb0
[gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents:
5691
diff
changeset
|
540 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
541 | if (!fgets(buf, sizeof(buf), f)) |
| 4491 | 542 | return account; |
| 1 | 543 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
544 | if (strcmp(buf, "\t\tuser_info {\n")) { |
| 4491 | 545 | return account; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
546 | } |
| 1 | 547 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
548 | if (!fgets(buf, sizeof(buf), f)) |
| 4491 | 549 | return account; |
| 1 | 550 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
551 | *user_info = '\0'; |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
552 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
553 | while (strncmp(buf, "\t\t}", 3)) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
554 | if (strlen(buf) > 3) |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
555 | strcat(user_info, buf + 3); |
| 1 | 556 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
557 | if (!fgets(buf, sizeof(buf), f)) { |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
558 | gaim_account_set_user_info(account, user_info); |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
559 | |
| 4491 | 560 | return account; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
561 | } |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
562 | } |
| 1 | 563 | |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
564 | if ((i = strlen(user_info))) |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
565 | user_info[i - 1] = '\0'; |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
566 | |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
567 | if (*user_info != '.') |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
568 | gaim_account_set_user_info(account, user_info); |
|
1292
82820e0a3748
[gaim-migrate @ 1302]
Decklin Foster <decklin@red-bean.com>
parents:
1264
diff
changeset
|
569 | |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
570 | if (!fgets(buf, sizeof(buf), f)) { |
| 4491 | 571 | return account; |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
572 | } |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
573 | |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
574 | if (!strcmp(buf, "\t}")) { |
| 4491 | 575 | return account; |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
576 | } |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
577 | |
| 3493 | 578 | p = parse_line(buf, &parse_buffer); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
579 | |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
580 | if (strcmp(p->option, "user_opts")) |
| 4491 | 581 | return account; |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
582 | |
| 5804 | 583 | flags = atoi(p->value[0]); |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
584 | |
| 5804 | 585 | if (flags & OPT_ACCT_AUTO) |
| 586 | gaim_account_set_auto_login(account, GAIM_GTK_UI, TRUE); | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
587 | |
|
5659
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
588 | if (flags & OPT_ACCT_MAIL_CHECK) |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
589 | gaim_account_set_check_mail(account, TRUE); |
|
b263ee0ceaac
[gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents:
5655
diff
changeset
|
590 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
591 | if (!(flags & OPT_ACCT_REM_PASS)) |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
592 | gaim_account_set_remember_password(account, FALSE); |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
593 | |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
594 | gaim_account_set_protocol(account, atoi(p->value[1])); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
940
diff
changeset
|
595 | |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
596 | if (!fgets(buf, sizeof(buf), f)) |
| 4491 | 597 | return account; |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
598 | |
|
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
599 | if (!strcmp(buf, "\t}")) |
| 4491 | 600 | return account; |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
601 | |
| 3493 | 602 | p = parse_line(buf, &parse_buffer); |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
603 | |
|
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
604 | if (strcmp(p->option, "proto_opts")) |
| 4491 | 605 | return account; |
|
1051
d65ac9e2224f
[gaim-migrate @ 1061]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
606 | |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
607 | /* I hate this part. We must convert the protocol options. */ |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
608 | switch (gaim_account_get_protocol(account)) { |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
609 | /* TOC */ |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
610 | case GAIM_PROTO_TOC: |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
611 | if (*p->value[0] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
612 | gaim_account_set_string(account, "server", "toc.oscar.aol.com"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
613 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
614 | gaim_account_set_string(account, "server", p->value[0]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
615 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
616 | if (*p->value[1] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
617 | gaim_account_set_int(account, "port", 9898); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
618 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
619 | gaim_account_set_int(account, "port", atoi(p->value[1])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
620 | |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
621 | break; |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
622 | |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
623 | /* OSCAR */ |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
624 | case GAIM_PROTO_OSCAR: |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
625 | if (*p->value[0] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
626 | gaim_account_set_string(account, "server", |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
627 | "login.oscar.aol.com"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
628 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
629 | gaim_account_set_string(account, "server", p->value[0]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
630 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
631 | if (*p->value[1] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
632 | gaim_account_set_int(account, "port", 5190); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
633 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
634 | gaim_account_set_int(account, "port", atoi(p->value[1])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
635 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
636 | break; |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
637 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
638 | /* Jabber */ |
| 5612 | 639 | case GAIM_PROTO_JABBER: |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
640 | if (*p->value[0] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
641 | gaim_account_set_int(account, "port", 5222); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
642 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
643 | gaim_account_set_int(account, "port", atoi(p->value[0])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
644 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
645 | if (*p->value[1] != '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
646 | gaim_account_set_string(account, "connect_server", p->value[1]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
647 | |
| 5612 | 648 | break; |
| 649 | ||
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
650 | /* Napster */ |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
651 | case GAIM_PROTO_NAPSTER: |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
652 | if (*p->value[3] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
653 | gaim_account_set_string(account, "server", "64.124.41.187"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
654 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
655 | gaim_account_set_string(account, "server", p->value[3]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
656 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
657 | if (*p->value[4] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
658 | gaim_account_set_int(account, "port", 8888); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
659 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
660 | gaim_account_set_int(account, "port", atoi(p->value[4])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
661 | |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
662 | break; |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
663 | |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
664 | /* Yahoo! */ |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
665 | case GAIM_PROTO_YAHOO: |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
666 | if (*p->value[3] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
667 | gaim_account_set_string(account, "server", "scs.yahoo.com"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
668 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
669 | gaim_account_set_string(account, "server", p->value[3]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
670 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
671 | if (*p->value[4] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
672 | gaim_account_set_int(account, "port", 5050); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
673 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
674 | gaim_account_set_int(account, "port", atoi(p->value[4])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
675 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
676 | break; |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
677 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
678 | /* MSN */ |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
679 | case GAIM_PROTO_MSN: |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
680 | if (*p->value[3] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
681 | gaim_account_set_string(account, "server", |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
682 | "messenger.hotmail.com"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
683 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
684 | gaim_account_set_string(account, "server", p->value[3]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
685 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
686 | if (*p->value[4] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
687 | gaim_account_set_int(account, "port", 1863); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
688 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
689 | gaim_account_set_int(account, "port", atoi(p->value[4])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
690 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
691 | break; |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
692 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
693 | /* IRC */ |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
694 | case GAIM_PROTO_IRC: |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
695 | if (*p->value[0] != '\0' && |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
696 | strchr(gaim_account_get_username(account), '@') == NULL) { |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
697 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
698 | tmp = g_strdup_printf("%s@%s", |
|
6176
a1c4e2842de0
[gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents:
6175
diff
changeset
|
699 | gaim_account_get_username(account), |
|
a1c4e2842de0
[gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents:
6175
diff
changeset
|
700 | (!strcmp(p->value[0], "irc.openprojects.net") |
|
a1c4e2842de0
[gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents:
6175
diff
changeset
|
701 | ? "irc.freenode.net" : p->value[0])); |
| 5618 | 702 | gaim_account_set_username(account, tmp); |
| 703 | g_free(tmp); | |
| 704 | } | |
|
6175
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
705 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
706 | if (*p->value[1] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
707 | gaim_account_set_int(account, "port", 6667); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
708 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
709 | gaim_account_set_int(account, "port", atoi(p->value[1])); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
710 | |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
711 | if (*p->value[2] == '\0') |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
712 | gaim_account_set_string(account, "charset", "ISO-8859-1"); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
713 | else |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
714 | gaim_account_set_string(account, "charset", p->value[2]); |
|
25d51668e0e7
[gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents:
6144
diff
changeset
|
715 | |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
716 | break; |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
717 | |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
718 | default: |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
719 | break; |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
720 | } |
|
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
721 | |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
722 | if (!fgets(buf, sizeof(buf), f)) |
| 4491 | 723 | return account; |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
724 | |
|
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
725 | if (!strcmp(buf, "\t}")) |
| 4491 | 726 | return account; |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
727 | |
| 3493 | 728 | p = parse_line(buf, &parse_buffer); |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
729 | |
|
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
730 | if (strcmp(p->option, "iconfile")) |
| 4491 | 731 | return account; |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
732 | |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
733 | if (*p->value[0] != '\n' && *p->value[0] != '\0') |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
734 | gaim_account_set_buddy_icon(account, p->value[0]); |
|
2317
2f61c2641be6
[gaim-migrate @ 2327]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2313
diff
changeset
|
735 | |
| 3205 | 736 | if (!fgets(buf, sizeof(buf), f)) |
| 4491 | 737 | return account; |
| 3205 | 738 | |
| 739 | if (!strcmp(buf, "\t}")) | |
| 4491 | 740 | return account; |
| 3205 | 741 | |
| 3493 | 742 | p = parse_line(buf, &parse_buffer); |
| 3205 | 743 | |
| 744 | if (strcmp(p->option, "alias")) | |
| 4491 | 745 | return account; |
| 3205 | 746 | |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
747 | if (*p->value[0] != '\n' && *p->value[0] != '\0') |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
748 | gaim_account_set_alias(account, p->value[0]); |
| 3205 | 749 | |
| 4634 | 750 | if (!fgets(buf, sizeof(buf), f)) |
| 751 | return account; | |
| 752 | ||
| 753 | if (!strcmp(buf, "\t}")) | |
| 754 | return account; | |
| 755 | ||
| 756 | p = parse_line(buf, &parse_buffer); | |
| 757 | ||
| 758 | if (strcmp(p->option, "proxy_opts")) | |
| 759 | return account; | |
| 760 | ||
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
761 | if(atoi(p->value[0]) != GAIM_PROXY_USE_GLOBAL) { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
762 | GaimProxyInfo *info; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
763 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
764 | info = gaim_proxy_info_new(); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
765 | gaim_proxy_info_set_type(info, atoi(p->value[0])); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
766 | gaim_proxy_info_set_host(info, p->value[1]); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
767 | gaim_proxy_info_set_port(info, atoi(p->value[2])); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
768 | gaim_proxy_info_set_username(info, p->value[3]); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
769 | gaim_proxy_info_set_password(info, p->value[4]); |
| 5868 | 770 | |
| 771 | gaim_account_set_proxy_info(account, info); | |
| 4634 | 772 | } |
| 773 | ||
| 4491 | 774 | return account; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
775 | |
| 1 | 776 | } |
| 777 | ||
| 778 | static void gaimrc_read_users(FILE *f) | |
| 779 | { | |
| 780 | char buf[2048]; | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
781 | GaimAccount *account = NULL; |
| 3493 | 782 | struct parse parse_buffer; |
|
4410
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
783 | struct parse *p=NULL; |
| 1 | 784 | |
| 785 | buf[0] = 0; | |
| 786 | ||
|
4410
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
787 | while (fgets(buf, sizeof(buf), f)) { |
| 1 | 788 | if (buf[0] == '#') |
| 789 | continue; | |
|
4410
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
790 | else if(buf[0] == '}') |
|
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
791 | break; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
792 | |
| 3493 | 793 | p = parse_line(buf, &parse_buffer); |
| 1 | 794 | |
|
4410
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
795 | if (strcmp(p->option, "user")==0 || |
|
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
796 | strcmp(p->option, "current_user")==0) { |
|
5580
a5a3e6dfb409
[gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
797 | if((account=gaimrc_read_user(f))==NULL) { |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
798 | gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
799 | "Error reading in users from .gaimrc\n"); |
|
4410
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
800 | return; |
|
9e593f7acd2e
[gaim-migrate @ 4683]
Herman Bloggs <herman@bluedigits.com>
parents:
4405
diff
changeset
|
801 | } |
|
159
bd2436428efa
[gaim-migrate @ 169]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
158
diff
changeset
|
802 | } |
| 1 | 803 | } |
| 804 | } | |
| 805 | ||
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
806 | struct replace { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
807 | int old; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
808 | guint *val; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
809 | int new; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
810 | }; |
| 1 | 811 | |
| 5804 | 812 | #define OPT_GEN_ENTER_SENDS 0x00000001 |
| 813 | #define OPT_GEN_LOG_ALL 0x00000004 | |
| 814 | #define OPT_GEN_STRIP_HTML 0x00000008 | |
| 815 | #define OPT_GEN_POPUP_WINDOWS 0x00000020 | |
| 816 | #define OPT_GEN_SEND_LINKS 0x00000040 | |
| 817 | #define OPT_GEN_DEBUG 0x00000100 | |
| 818 | #define OPT_GEN_BROWSER_POPUP 0x00000800 | |
| 819 | #define OPT_GEN_CHECK_SPELLING 0x00008000 | |
| 820 | #define OPT_GEN_POPUP_CHAT 0x00010000 | |
| 821 | #define OPT_GEN_BACK_ON_IM 0x00020000 | |
| 822 | #define OPT_GEN_CTL_CHARS 0x00080000 | |
| 823 | #define OPT_GEN_CTL_SMILEYS 0x00200000 | |
| 824 | #define OPT_GEN_AUTO_AWAY 0x00800000 | |
| 825 | #define OPT_GEN_ESC_CAN_CLOSE 0x01000000 | |
| 826 | #define OPT_GEN_CTL_ENTER 0x02000000 | |
| 827 | #define OPT_GEN_F2_TOGGLES 0x04000000 | |
| 828 | #define OPT_GEN_NO_AUTO_RESP 0x08000000 | |
| 829 | #define OPT_GEN_QUEUE_WHEN_AWAY 0x10000000 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
830 | |
| 5804 | 831 | #define OPT_DISP_SHOW_TIME 0x00000001 |
| 832 | #define OPT_DISP_SHOW_GRPNUM 0x00000002 | |
| 833 | #define OPT_DISP_SHOW_IDLETIME 0x00000008 | |
| 834 | #define OPT_DISP_SHOW_BUTTON_XPM 0x00000010 | |
| 835 | #define OPT_DISP_IGNORE_COLOUR 0x00000020 | |
| 836 | #define OPT_DISP_SHOW_LOGON 0x00000040 | |
| 837 | #define OPT_DISP_SHOW_SMILEY 0x00000100 | |
| 838 | #define OPT_DISP_CHAT_LOGON 0x00000800 | |
| 839 | #define OPT_DISP_NO_BUTTONS 0x00002000 | |
| 840 | #define OPT_DISP_CONV_BUTTON_TEXT 0x00004000 | |
| 841 | #define OPT_DISP_CHAT_BUTTON_TEXT 0x00008000 | |
| 842 | #define OPT_DISP_NO_MT_GRP 0x00040000 | |
| 843 | #define OPT_DISP_CONV_BUTTON_XPM 0x00080000 | |
| 844 | #define OPT_DISP_CHAT_BUTTON_XPM 0x00100000 | |
| 845 | #define OPT_DISP_SHOW_WARN 0x00200000 | |
| 846 | #define OPT_DISP_IGNORE_FONTS 0x00400000 | |
| 847 | #define OPT_DISP_IGNORE_SIZES 0x00800000 | |
| 848 | #define OPT_DISP_ONE_CHAT_WINDOW 0x02000000 | |
| 849 | #define OPT_DISP_CONV_SIDE_TAB 0x04000000 | |
| 850 | #define OPT_DISP_CONV_BR_TAB 0x08000000 | |
| 1 | 851 | |
| 852 | static void gaimrc_read_options(FILE *f) | |
| 853 | { | |
| 854 | char buf[2048]; | |
| 3493 | 855 | struct parse parse_buffer; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
856 | struct parse *p; |
| 5804 | 857 | gboolean read_logging = FALSE, read_general = FALSE; |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
858 | int general_options = 0, display_options = 0; |
| 1 | 859 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
860 | buf[0] = 0; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
861 | |
| 1 | 862 | while (buf[0] != '}') { |
| 863 | if (buf[0] == '#') | |
| 864 | continue; | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
865 | |
| 1 | 866 | if (!fgets(buf, sizeof(buf), f)) |
| 867 | return; | |
| 868 | ||
| 3493 | 869 | p = parse_line(buf, &parse_buffer); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
870 | |
| 5672 | 871 | /* XXX: what are we going to do about ancient prefs? */ |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
872 | if (!strcmp(p->option, "general_options")) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
873 | general_options = atoi(p->value[0]); |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
874 | read_general = TRUE; |
| 5804 | 875 | gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends", |
| 876 | general_options & OPT_GEN_ENTER_SENDS); | |
| 877 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events", | |
| 878 | general_options & OPT_GEN_POPUP_WINDOWS); | |
| 879 | gaim_prefs_set_bool("/gaim/gtk/debug/enabled", | |
| 880 | general_options & OPT_GEN_DEBUG); | |
| 8283 | 881 | #ifndef _WIN32 |
|
8272
c1e38e0ec1d5
[gaim-migrate @ 8996]
Nathan Fredrickson <nathan@silverorange.com>
parents:
8046
diff
changeset
|
882 | gaim_prefs_set_int("/gaim/gtk/browsers/place", |
|
c1e38e0ec1d5
[gaim-migrate @ 8996]
Nathan Fredrickson <nathan@silverorange.com>
parents:
8046
diff
changeset
|
883 | (general_options & OPT_GEN_BROWSER_POPUP) ? |
|
c1e38e0ec1d5
[gaim-migrate @ 8996]
Nathan Fredrickson <nathan@silverorange.com>
parents:
8046
diff
changeset
|
884 | GAIM_BROWSER_NEW_WINDOW : GAIM_BROWSER_DEFAULT ); |
| 8283 | 885 | #endif |
| 5804 | 886 | gaim_prefs_set_bool("/gaim/gtk/conversations/spellecheck", |
| 887 | general_options & OPT_GEN_CHECK_SPELLING); | |
| 888 | gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events", | |
| 889 | general_options & OPT_GEN_POPUP_CHAT); | |
| 890 | gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts", | |
| 891 | general_options & OPT_GEN_CTL_CHARS); | |
| 892 | gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts", | |
| 893 | general_options & OPT_GEN_CTL_SMILEYS); | |
| 894 | gaim_prefs_set_bool("/core/away/away_when_idle", | |
| 895 | general_options & OPT_GEN_AUTO_AWAY); | |
| 896 | gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes", | |
| 897 | general_options & OPT_GEN_ESC_CAN_CLOSE); | |
| 898 | gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends", | |
| 899 | general_options & OPT_GEN_CTL_ENTER); | |
| 900 | gaim_prefs_set_bool("/core/away/auto_response/enabled", | |
| 901 | !(general_options & OPT_GEN_NO_AUTO_RESP)); | |
| 902 | gaim_prefs_set_bool("/gaim/gtk/away/queu_messages", | |
| 903 | general_options & OPT_AWAY_QUEUE); | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
904 | } else if (!strcmp(p->option, "display_options")) { |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
905 | display_options = atoi(p->value[0]); |
| 5804 | 906 | gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", |
| 907 | display_options & OPT_DISP_SHOW_TIME); | |
| 908 | gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time", | |
| 909 | display_options & OPT_DISP_SHOW_IDLETIME); | |
| 910 | gaim_prefs_set_int("/gaim/gtk/blist/button_style", | |
| 911 | ((display_options & OPT_DISP_SHOW_BUTTON_XPM) | |
| 912 | ? ((display_options & OPT_DISP_NO_BUTTONS) | |
| 913 | ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE) | |
| 914 | : ((display_options & OPT_DISP_NO_BUTTONS) | |
| 915 | ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT))); | |
|
5889
6286f93e54b4
[gaim-migrate @ 6321]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
916 | gaim_prefs_set_int("/gaim/gtk/conversations/im/button_type", |
| 5804 | 917 | ((display_options & OPT_DISP_CONV_BUTTON_XPM) |
| 918 | ? ((display_options & OPT_DISP_CONV_BUTTON_TEXT) | |
| 919 | ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
| 920 | : ((display_options & OPT_DISP_CONV_BUTTON_TEXT) | |
| 921 | ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
|
5889
6286f93e54b4
[gaim-migrate @ 6321]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
922 | gaim_prefs_set_int("/gaim/gtk/conversations/chat/button_type", |
| 5804 | 923 | ((display_options & OPT_DISP_CHAT_BUTTON_XPM) |
| 924 | ? ((display_options & OPT_DISP_CHAT_BUTTON_TEXT) | |
| 925 | ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
| 926 | : ((display_options & OPT_DISP_CHAT_BUTTON_TEXT) | |
| 927 | ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
| 928 | gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level", | |
| 929 | display_options & OPT_DISP_SHOW_WARN); | |
| 930 | gaim_prefs_set_int("/gaim/gtk/conversations/tab_side", | |
| 931 | ((display_options & OPT_DISP_CONV_SIDE_TAB) | |
| 932 | ? ((display_options & OPT_DISP_CONV_BR_TAB) | |
| 933 | ? GTK_POS_RIGHT : GTK_POS_LEFT) | |
| 934 | : ((display_options & OPT_DISP_CONV_BR_TAB) | |
| 935 | ? GTK_POS_BOTTOM : GTK_POS_TOP))); | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
936 | } else if (!strcmp(p->option, "misc_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
937 | misc_options = atoi(p->value[0]); |
| 5631 | 938 | gaim_prefs_set_bool("/gaim/gtk/debug/enabled", |
| 5823 | 939 | misc_options & OPT_MISC_DEBUG); |
| 5631 | 940 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/send_typing", |
| 5823 | 941 | !(misc_options & OPT_MISC_STEALTH_TYPING)); |
| 5631 | 942 | gaim_prefs_set_bool("/gaim/gtk/buddies/use_server_alias", |
| 5823 | 943 | misc_options & OPT_MISC_USE_SERVER_ALIAS); |
|
1525
b4ece1a718cd
[gaim-migrate @ 1535]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1456
diff
changeset
|
944 | } else if (!strcmp(p->option, "logging_options")) { |
|
b4ece1a718cd
[gaim-migrate @ 1535]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1456
diff
changeset
|
945 | logging_options = atoi(p->value[0]); |
|
b4ece1a718cd
[gaim-migrate @ 1535]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1456
diff
changeset
|
946 | read_logging = TRUE; |
|
7562
7cbd89f3cef1
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
947 | gaim_prefs_set_bool("/core/logging/log_ims", |
| 5823 | 948 | logging_options & OPT_LOG_CONVOS); |
|
7562
7cbd89f3cef1
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
949 | gaim_prefs_set_bool("/core/logging/log_chats", |
| 5823 | 950 | logging_options & OPT_LOG_CHATS); |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
951 | } else if (!strcmp(p->option, "blist_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
952 | blist_options = atoi(p->value[0]); |
| 5631 | 953 | gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time", |
| 5823 | 954 | blist_options & OPT_BLIST_SHOW_IDLETIME); |
| 5631 | 955 | gaim_prefs_set_bool("/gaim/gtk/blist/show_empty_groups", |
| 5823 | 956 | !(blist_options & OPT_BLIST_NO_MT_GRP)); |
| 5631 | 957 | gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level", |
| 5823 | 958 | blist_options & OPT_BLIST_SHOW_WARN); |
| 5631 | 959 | gaim_prefs_set_bool("/gaim/gtk/blist/grey_idle_buddies", |
| 5823 | 960 | blist_options & OPT_BLIST_GREY_IDLERS); |
| 5631 | 961 | gaim_prefs_set_bool("/gaim/gtk/blist/raise_on_events", |
| 5823 | 962 | blist_options & OPT_BLIST_POPUP); |
| 5631 | 963 | gaim_prefs_set_bool("/gaim/gtk/blist/show_buddy_icons", |
| 5823 | 964 | blist_options & OPT_BLIST_SHOW_ICONS); |
| 5631 | 965 | gaim_prefs_set_bool("/gaim/gtk/blist/show_offline_buddies", |
| 5823 | 966 | blist_options & OPT_BLIST_SHOW_OFFLINE); |
| 5672 | 967 | gaim_prefs_set_int("/gaim/gtk/blist/button_style", |
| 968 | ((blist_options & OPT_BLIST_SHOW_BUTTON_XPM) | |
| 969 | ? ((blist_options & OPT_BLIST_NO_BUTTON_TEXT) | |
| 970 | ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE) | |
| 971 | : ((blist_options & OPT_BLIST_NO_BUTTON_TEXT) | |
| 972 | ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT))); | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
973 | } else if (!strcmp(p->option, "convo_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
974 | convo_options = atoi(p->value[0]); |
| 5631 | 975 | gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends", |
| 5823 | 976 | convo_options & OPT_CONVO_ENTER_SENDS); |
| 5631 | 977 | gaim_prefs_set_bool("/gaim/gtk/conversations/spellcheck", |
| 5823 | 978 | convo_options & OPT_CONVO_CHECK_SPELLING); |
| 5631 | 979 | gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts", |
| 5823 | 980 | convo_options & OPT_CONVO_CTL_CHARS); |
| 5631 | 981 | gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts", |
| 5823 | 982 | convo_options & OPT_CONVO_CTL_SMILEYS); |
| 5631 | 983 | gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes", |
| 5823 | 984 | convo_options & OPT_CONVO_ESC_CAN_CLOSE); |
| 5631 | 985 | gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends", |
| 5823 | 986 | convo_options & OPT_CONVO_CTL_ENTER); |
| 5631 | 987 | gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", |
| 5823 | 988 | convo_options & OPT_CONVO_SHOW_TIME); |
| 5631 | 989 | gaim_prefs_set_bool("/core/conversations/combine_chat_im", |
| 5823 | 990 | convo_options & OPT_CONVO_COMBINE); |
| 5631 | 991 | gaim_prefs_set_bool("/gaim/gtk/conversations/close_on_tabs", |
| 5823 | 992 | !(convo_options & OPT_CONVO_NO_X_ON_TAB)); |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
993 | } else if (!strcmp(p->option, "im_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
994 | im_options = atoi(p->value[0]); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
995 | |
| 5672 | 996 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events", |
| 997 | im_options & OPT_IM_POPUP); | |
| 998 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/button_type", | |
| 999 | ((im_options & OPT_IM_BUTTON_XPM) | |
| 1000 | ? ((im_options & OPT_IM_BUTTON_TEXT) | |
| 1001 | ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
| 1002 | : ((im_options & OPT_IM_BUTTON_TEXT) | |
| 1003 | ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
| 5667 | 1004 | gaim_prefs_set_int("/gaim/gtk/conversations/tab_side", |
| 1005 | ((im_options & OPT_IM_SIDE_TAB) | |
| 5672 | 1006 | ? ((im_options & OPT_IM_BR_TAB) |
| 1007 | ? GTK_POS_RIGHT : GTK_POS_LEFT) | |
| 1008 | : ((im_options & OPT_IM_BR_TAB) | |
| 1009 | ? GTK_POS_BOTTOM : GTK_POS_TOP))); | |
| 1010 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/show_buddy_icons", | |
| 1011 | !(im_options & OPT_IM_HIDE_ICONS)); | |
| 1012 | gaim_prefs_set_bool("/gaim/gtk/conversations/im/animate_buddy_icons", | |
| 1013 | !(im_options & OPT_IM_NO_ANIMATION)); | |
| 1014 | gaim_prefs_set_bool("/core/conversations/use_alias_for_title", | |
| 1015 | im_options & OPT_IM_ALIAS_TAB); | |
| 6799 | 1016 | gaim_prefs_set_bool("/gaim/gtk/conversations/tabs", |
| 1017 | im_options & OPT_IM_ONE_WINDOW); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1018 | |
|
4469
ef60c820b884
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
1019 | } else if (!strcmp(p->option, "conv_placement")) { |
| 5858 | 1020 | switch(atoi(p->value[0])) { |
| 1021 | case 1: | |
|
7561
fd6a81f1594e
[gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents:
7431
diff
changeset
|
1022 | gaim_prefs_set_string("/gaim/gtk/conversations/placement", |
| 5858 | 1023 | "new"); |
| 1024 | break; | |
| 1025 | case 2: | |
|
7561
fd6a81f1594e
[gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents:
7431
diff
changeset
|
1026 | gaim_prefs_set_string("/gaim/gtk/conversations/placement", |
| 5858 | 1027 | "group"); |
| 1028 | break; | |
| 1029 | case 3: | |
|
7561
fd6a81f1594e
[gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents:
7431
diff
changeset
|
1030 | gaim_prefs_set_string("/gaim/gtk/conversations/placement", |
| 5858 | 1031 | "account"); |
| 1032 | break; | |
| 1033 | case 0: | |
| 1034 | default: | |
|
7561
fd6a81f1594e
[gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents:
7431
diff
changeset
|
1035 | gaim_prefs_set_string("/gaim/gtk/conversations/placement", |
| 5858 | 1036 | "last"); |
| 1037 | break; | |
| 1038 | } | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1039 | } else if (!strcmp(p->option, "chat_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1040 | chat_options = atoi(p->value[0]); |
| 5672 | 1041 | |
| 1042 | gaim_prefs_set_bool("/gaim/gtk/conversations/chat/button_type", | |
| 1043 | ((chat_options & OPT_CHAT_BUTTON_XPM) | |
| 1044 | ? ((chat_options & OPT_CHAT_BUTTON_TEXT) | |
| 1045 | ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE) | |
| 1046 | : ((chat_options & OPT_CHAT_BUTTON_TEXT) | |
| 1047 | ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE))); | |
| 1048 | gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events", | |
| 1049 | chat_options & OPT_CHAT_POPUP); | |
| 1050 | gaim_prefs_set_bool("/gaim/gtk/conversations/chat/color_nicks", | |
| 1051 | chat_options & OPT_CHAT_COLORIZE); | |
| 1052 | ||
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1053 | } else if (!strcmp(p->option, "font_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1054 | font_options = atoi(p->value[0]); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1055 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1056 | gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", |
| 5823 | 1057 | font_options & OPT_FONT_BOLD); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1058 | gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", |
| 5823 | 1059 | font_options & OPT_FONT_ITALIC); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1060 | gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", |
| 5823 | 1061 | font_options & OPT_FONT_UNDERLINE); |
| 9025 | 1062 | gaim_prefs_set_bool("/gaim/gtk/conversations/send_formatting", |
| 5823 | 1063 | font_options & OPT_FONT_FACE); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1064 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1065 | } else if (!strcmp(p->option, "sound_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1066 | sound_options = atoi(p->value[0]); |
| 5691 | 1067 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/login", |
| 1068 | sound_options & OPT_SOUND_LOGIN); | |
| 1069 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/logout", | |
| 1070 | sound_options & OPT_SOUND_LOGOUT); | |
| 1071 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/im_recv", | |
| 1072 | sound_options & OPT_SOUND_RECV); | |
| 1073 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_im", | |
| 1074 | sound_options & OPT_SOUND_SEND); | |
| 1075 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/first_im_recv", | |
| 1076 | sound_options & OPT_SOUND_FIRST_RCV); | |
| 1077 | gaim_prefs_set_bool("/core/sound/when_away", | |
| 1078 | sound_options & OPT_SOUND_WHEN_AWAY); | |
| 1079 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/join_chat", | |
| 1080 | sound_options & OPT_SOUND_CHAT_JOIN); | |
| 1081 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/chat_msg_recv", | |
| 1082 | sound_options & OPT_SOUND_CHAT_SAY); | |
| 1083 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/left_chat", | |
| 1084 | sound_options & OPT_SOUND_CHAT_PART); | |
| 1085 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_chat_msg", | |
| 1086 | sound_options & OPT_SOUND_CHAT_YOU_SAY); | |
| 1087 | gaim_prefs_set_bool("/gaim/gtk/sound/enabled/nick_said", | |
| 1088 | sound_options & OPT_SOUND_CHAT_NICK); | |
| 1089 | if(sound_options & OPT_SOUND_NAS) { | |
| 1090 | gaim_prefs_set_string("/gaim/gtk/sound/method", "nas"); | |
| 1091 | } else if(!(sound_options & OPT_SOUND_NORMAL)) { | |
| 1092 | if(sound_options & OPT_SOUND_ESD) | |
| 1093 | gaim_prefs_set_string("/gaim/gtk/sound/method", "esd"); | |
| 1094 | else if(sound_options & OPT_SOUND_ARTS) | |
| 1095 | gaim_prefs_set_string("/gaim/gtk/sound/method", "arts"); | |
| 1096 | else if(sound_options & OPT_SOUND_CMD) | |
| 1097 | gaim_prefs_set_string("/gaim/gtk/sound/method", "custom"); | |
| 1098 | else if(sound_options & OPT_SOUND_BEEP) | |
| 1099 | gaim_prefs_set_string("/gaim/gtk/sound/method", "beep"); | |
| 1100 | } | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1101 | } else if (!strcmp(p->option, "away_options")) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1102 | away_options = atoi(p->value[0]); |
| 5672 | 1103 | gaim_prefs_set_bool("/core/away/away_when_idle", |
| 1104 | away_options & OPT_AWAY_AUTO); | |
| 1105 | gaim_prefs_set_bool("/core/away/auto_response/enabled", | |
| 1106 | !(away_options & OPT_AWAY_NO_AUTO_RESP)); | |
| 1107 | gaim_prefs_set_bool("/gaim/gtk/away/queue_messages", | |
| 1108 | away_options & OPT_AWAY_QUEUE); | |
| 1109 | gaim_prefs_set_bool("/core/away/auto_response/idle_only", | |
| 1110 | away_options & OPT_AWAY_IDLE_RESP); | |
| 1111 | gaim_prefs_set_bool("/plugins/gtk/docklet/queue_messages", | |
| 1112 | away_options & OPT_AWAY_QUEUE_UNREAD); | |
|
666
0a313fec9a15
[gaim-migrate @ 676]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
570
diff
changeset
|
1113 | } else if (!strcmp(p->option, "font_face")) { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1114 | gaim_prefs_set_string("/gaim/gtk/conversations/font_face", |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1115 | p->value[0]); |
|
1441
71e46d36113b
[gaim-migrate @ 1451]
Decklin Foster <decklin@red-bean.com>
parents:
1420
diff
changeset
|
1116 | } else if (!strcmp(p->option, "font_size")) { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1117 | gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0])); |
|
666
0a313fec9a15
[gaim-migrate @ 676]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
570
diff
changeset
|
1118 | } else if (!strcmp(p->option, "foreground")) { |
| 5671 | 1119 | char buf[14]; |
| 5650 | 1120 | |
| 5671 | 1121 | g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
| 1122 | atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1123 | gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1124 | |
|
666
0a313fec9a15
[gaim-migrate @ 676]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
570
diff
changeset
|
1125 | } else if (!strcmp(p->option, "background")) { |
| 5671 | 1126 | char buf[14]; |
| 5650 | 1127 | |
| 5671 | 1128 | g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
| 1129 | atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2])); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1130 | gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5537
diff
changeset
|
1131 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1132 | } else if (!strcmp(p->option, "report_idle")) { |
| 5631 | 1133 | switch(atoi(p->value[0])) { |
| 1134 | case IDLE_SCREENSAVER: | |
| 1135 | gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
| 1136 | "system"); | |
| 1137 | break; | |
| 1138 | case IDLE_GAIM: | |
| 1139 | gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
| 1140 | "gaim"); | |
| 1141 | break; | |
| 1142 | default: | |
| 1143 | gaim_prefs_set_string("/gaim/gtk/idle/reporting_method", | |
| 1144 | "none"); | |
| 1145 | break; | |
| 1146 | } | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1147 | } else if (!strcmp(p->option, "web_browser")) { |
| 5633 | 1148 | switch(atoi(p->value[0])) { |
| 1149 | case BROWSER_NETSCAPE: | |
| 1150 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1151 | "netscape"); | |
| 1152 | break; | |
| 1153 | case BROWSER_KONQ: | |
| 1154 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1155 | "kfmclient"); | |
| 1156 | break; | |
| 1157 | case BROWSER_MANUAL: | |
| 1158 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1159 | "manual"); | |
| 1160 | break; | |
| 1161 | case BROWSER_GNOME: | |
| 1162 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1163 | "gnome"); | |
| 1164 | break; | |
| 1165 | case BROWSER_OPERA: | |
| 1166 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1167 | "opera"); | |
| 1168 | break; | |
| 1169 | case BROWSER_GALEON: | |
| 1170 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1171 | "galeon"); | |
| 1172 | break; | |
| 1173 | case BROWSER_MOZILLA: | |
| 1174 | default: | |
| 1175 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", | |
| 1176 | "mozilla"); | |
| 1177 | break; | |
| 1178 | } | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1179 | } else if (!strcmp(p->option, "web_command")) { |
| 5633 | 1180 | gaim_prefs_set_string("/gaim/gtk/browsers/command", p->value[0]); |
| 4288 | 1181 | } else if (!strcmp(p->option, "smiley_theme")) { |
| 5841 | 1182 | gaim_prefs_set_string("/gaim/gtk/smileys/theme", p->value[0]); |
|
1813
9b174ae83add
[gaim-migrate @ 1823]
Decklin Foster <decklin@red-bean.com>
parents:
1710
diff
changeset
|
1183 | } else if (!strcmp(p->option, "conv_size")) { |
| 5633 | 1184 | gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width", |
| 1185 | atoi(p->value[0])); | |
| 1186 | gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", | |
| 1187 | atoi(p->value[1])); | |
|
6098
e334abadb5dc
[gaim-migrate @ 6557]
Christian Hammond <chipx86@chipx86.com>
parents:
6097
diff
changeset
|
1188 | gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_height", |
| 5633 | 1189 | atoi(p->value[2])); |
|
1813
9b174ae83add
[gaim-migrate @ 1823]
Decklin Foster <decklin@red-bean.com>
parents:
1710
diff
changeset
|
1190 | } else if (!strcmp(p->option, "buddy_chat_size")) { |
| 5633 | 1191 | gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width", |
| 1192 | atoi(p->value[0])); | |
| 1193 | gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", | |
| 1194 | atoi(p->value[1])); | |
|
6098
e334abadb5dc
[gaim-migrate @ 6557]
Christian Hammond <chipx86@chipx86.com>
parents:
6097
diff
changeset
|
1195 | gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_height", |
| 5633 | 1196 | atoi(p->value[2])); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1197 | } else if (!strcmp(p->option, "blist_pos")) { |
| 5633 | 1198 | gaim_prefs_set_int("/gaim/gtk/blist/x", atoi(p->value[0])); |
| 1199 | gaim_prefs_set_int("/gaim/gtk/blist/y", atoi(p->value[1])); | |
| 1200 | gaim_prefs_set_int("/gaim/gtk/blist/width", atoi(p->value[2])); | |
| 1201 | gaim_prefs_set_int("/gaim/gtk/blist/height", atoi(p->value[3])); | |
| 5422 | 1202 | } else if (!strcmp(p->option, "sort_method")) { |
| 6144 | 1203 | if(!strcmp(p->value[0], _("Alphabetical"))) |
| 1204 | gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "alphabetical"); | |
| 1205 | else if(!strcmp(p->value[0], _("By status"))) | |
| 1206 | gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "status"); | |
| 1207 | else if(!strcmp(p->value[0], _("By log size"))) | |
| 1208 | gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "log_size"); | |
| 1209 | else | |
| 1210 | gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "none"); | |
|
82
33bc54b6c16a
[gaim-migrate @ 92]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
44
diff
changeset
|
1211 | } |
| 1 | 1212 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1213 | } |
| 1 | 1214 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1215 | if (read_general) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1216 | if (!read_logging) { |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1217 | logging_options = 0; |
|
7562
7cbd89f3cef1
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1218 | gaim_prefs_set_bool("/core/logging/log_ims", |
| 5823 | 1219 | general_options & OPT_GEN_LOG_ALL); |
|
7562
7cbd89f3cef1
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1220 | gaim_prefs_set_bool("/core/logging/log_chats", |
| 5823 | 1221 | general_options & OPT_GEN_LOG_ALL); |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1222 | } |
|
1525
b4ece1a718cd
[gaim-migrate @ 1535]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1456
diff
changeset
|
1223 | } |
|
b4ece1a718cd
[gaim-migrate @ 1535]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1456
diff
changeset
|
1224 | |
| 3391 | 1225 | if (misc_options & OPT_MISC_BUDDY_TICKER) { |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1226 | if (gaim_plugins_enabled()) { |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1227 | gchar* buf; |
| 3630 | 1228 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1229 | buf = g_strconcat(LIBDIR, G_DIR_SEPARATOR_S, |
| 3630 | 1230 | #ifndef _WIN32 |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1231 | "ticker.so", |
| 3630 | 1232 | #else |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1233 | "ticker.dll", |
| 3630 | 1234 | #endif |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1235 | NULL); |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1236 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1237 | gaim_plugin_load(gaim_plugin_probe(buf)); |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1238 | g_free(buf); |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1239 | } |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1240 | |
| 3391 | 1241 | misc_options &= ~OPT_MISC_BUDDY_TICKER; |
| 5823 | 1242 | } |
| 1 | 1243 | } |
| 1244 | ||
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1245 | static void gaimrc_read_sounds(FILE *f) |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1246 | { |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1247 | int i; |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1248 | char buf[2048]; |
| 3493 | 1249 | struct parse parse_buffer; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1250 | struct parse *p; |
| 5684 | 1251 | char *pref_name; |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1252 | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1253 | buf[0] = 0; |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1254 | |
| 5684 | 1255 | for(i=0; i<GAIM_NUM_SOUNDS; i++) { |
| 1256 | pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
| 1257 | gaim_gtk_sound_get_event_option(i)); | |
| 1258 | gaim_prefs_set_string(pref_name, ""); | |
| 1259 | g_free(pref_name); | |
| 1260 | } | |
| 4561 | 1261 | |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1262 | while (buf[0] != '}') { |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1263 | if (buf[0] == '#') |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1264 | continue; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1265 | |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1266 | if (!fgets(buf, sizeof(buf), f)) |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1267 | return; |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1268 | |
| 3493 | 1269 | p = parse_line(buf, &parse_buffer); |
| 3630 | 1270 | #ifndef _WIN32 |
|
1214
dccd13b431d5
[gaim-migrate @ 1224]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1209
diff
changeset
|
1271 | if (!strcmp(p->option, "sound_cmd")) { |
| 5684 | 1272 | gaim_prefs_set_string("/gaim/gtk/sound/command", p->value[0]); |
| 4561 | 1273 | } else |
| 3630 | 1274 | #endif |
| 1275 | if (!strncmp(p->option, "sound", strlen("sound"))) { | |
|
2036
4739b7aa2a84
[gaim-migrate @ 2046]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1976
diff
changeset
|
1276 | i = p->option[strlen("sound")] - 'A'; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1277 | |
| 5684 | 1278 | pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s", |
| 1279 | gaim_gtk_sound_get_event_option(i)); | |
| 1280 | gaim_prefs_set_string(pref_name, p->value[0]); | |
|
6040
ab00305db747
[gaim-migrate @ 6490]
Mark Doliner <markdoliner@pidgin.im>
parents:
6033
diff
changeset
|
1281 | g_free(pref_name); |
|
1214
dccd13b431d5
[gaim-migrate @ 1224]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1209
diff
changeset
|
1282 | } |
|
1006
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1283 | } |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1284 | } |
|
fb2f2a403962
[gaim-migrate @ 1016]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1285 | |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1286 | static void gaimrc_read_proxy(FILE *f) |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1287 | { |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1288 | char buf[2048]; |
| 3493 | 1289 | struct parse parse_buffer; |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1290 | struct parse *p; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1291 | GaimProxyInfo *info; |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1292 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1293 | info = gaim_global_proxy_get_info(); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1294 | |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1295 | buf[0] = 0; |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1296 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "gaimrc_read_proxy\n"); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1297 | |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1298 | while (buf[0] != '}') { |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1299 | if (buf[0] == '#') |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1300 | continue; |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1301 | |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1302 | if (!fgets(buf, sizeof(buf), f)) |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1303 | return; |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1304 | |
| 3493 | 1305 | p = parse_line(buf, &parse_buffer); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1306 | |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1307 | if (!strcmp(p->option, "host")) { |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1308 | gaim_proxy_info_set_host(info, p->value[0]); |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1309 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1310 | "Set proxyhost %s\n", p->value[0]); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1311 | } else if (!strcmp(p->option, "port")) { |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1312 | gaim_proxy_info_set_port(info, atoi(p->value[0])); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1313 | } else if (!strcmp(p->option, "type")) { |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1314 | gaim_proxy_info_set_type(info, atoi(p->value[0])); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1315 | } else if (!strcmp(p->option, "user")) { |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1316 | gaim_proxy_info_set_username(info, p->value[0]); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1317 | } else if (!strcmp(p->option, "pass")) { |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5672
diff
changeset
|
1318 | gaim_proxy_info_set_password(info, p->value[0]); |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1319 | } |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1320 | } |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1321 | } |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1322 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1323 | static void set_defaults() |
| 1 | 1324 | { |
| 5631 | 1325 | #if 0 |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1326 | int i; |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1327 | struct away_message *a; |
| 917 | 1328 | |
| 4227 | 1329 | misc_options = |
| 1330 | OPT_MISC_USE_SERVER_ALIAS; | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1331 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1332 | logging_options = 0; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1333 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1334 | blist_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1335 | OPT_BLIST_SHOW_GRPNUM | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1336 | OPT_BLIST_SHOW_PIXMAPS | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1337 | OPT_BLIST_SHOW_IDLETIME | |
| 3367 | 1338 | OPT_BLIST_GREY_IDLERS | |
| 4962 | 1339 | OPT_BLIST_SHOW_BUTTON_XPM | |
| 1340 | OPT_BLIST_SHOW_ICONS; | |
| 870 | 1341 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1342 | convo_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1343 | OPT_CONVO_ENTER_SENDS | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1344 | OPT_CONVO_SEND_LINKS | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1345 | OPT_CONVO_CTL_CHARS | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1346 | OPT_CONVO_CTL_SMILEYS | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1347 | OPT_CONVO_SHOW_TIME | |
| 3919 | 1348 | OPT_CONVO_SHOW_SMILEY | |
| 1349 | OPT_CONVO_CHECK_SPELLING; | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1350 | |
|
4469
ef60c820b884
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
1351 | conv_placement_option = 0; |
|
ef60c820b884
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4430
diff
changeset
|
1352 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1353 | im_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1354 | OPT_IM_LOGON | |
| 3367 | 1355 | OPT_IM_BUTTON_XPM | |
| 1356 | OPT_IM_ONE_WINDOW ; | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1357 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1358 | chat_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1359 | OPT_CHAT_LOGON | |
|
2388
daf70f99d89f
[gaim-migrate @ 2401]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2383
diff
changeset
|
1360 | OPT_CHAT_BUTTON_XPM | |
| 3367 | 1361 | OPT_CHAT_ONE_WINDOW; |
| 870 | 1362 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1363 | font_options = 0; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1364 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1365 | away_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1366 | OPT_AWAY_BACK_ON_IM; |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1367 | |
| 4561 | 1368 | for (i = 0; i < GAIM_NUM_SOUNDS; i++) |
| 1369 | gaim_sound_set_event_file(i, NULL); | |
| 1370 | ||
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1371 | font_options = 0; |
|
2580
b6e87f6ad217
[gaim-migrate @ 2593]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2397
diff
changeset
|
1372 | /* Enable all of the sound players that might be available. The first |
|
b6e87f6ad217
[gaim-migrate @ 2593]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2397
diff
changeset
|
1373 | available one will be used. */ |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1374 | sound_options = |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1375 | OPT_SOUND_LOGIN | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1376 | OPT_SOUND_LOGOUT | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1377 | OPT_SOUND_RECV | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1378 | OPT_SOUND_SEND | |
|
2580
b6e87f6ad217
[gaim-migrate @ 2593]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2397
diff
changeset
|
1379 | OPT_SOUND_SILENT_SIGNON | |
| 4581 | 1380 | OPT_SOUND_NORMAL | |
| 1381 | OPT_SOUND_NAS; | |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1382 | |
| 2990 | 1383 | #ifdef USE_SCREENSAVER |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1384 | report_idle = IDLE_SCREENSAVER; |
| 2990 | 1385 | #else |
| 1386 | report_idle = IDLE_GAIM; | |
| 1387 | #endif | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1388 | web_browser = BROWSER_NETSCAPE; |
| 3434 | 1389 | g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s"); |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1390 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1391 | auto_away = 10; |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1392 | a = g_new0(struct away_message, 1); |
|
4589
e6d7d19da849
[gaim-migrate @ 4873]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
4581
diff
changeset
|
1393 | g_snprintf(a->name, sizeof(a->name), _("boring default")); |
|
6321
0b54b2a172d1
[gaim-migrate @ 6820]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
6223
diff
changeset
|
1394 | g_snprintf(a->message, sizeof(a->message), "%s", _(BORING_DEFAULT_AWAY_MSG)); |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1395 | away_messages = g_slist_append(away_messages, a); |
|
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1396 | default_away = a; |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1397 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1398 | blist_pos.width = 0; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1399 | blist_pos.height = 0; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1400 | blist_pos.x = 0; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1401 | blist_pos.y = 0; |
|
1813
9b174ae83add
[gaim-migrate @ 1823]
Decklin Foster <decklin@red-bean.com>
parents:
1710
diff
changeset
|
1402 | |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1403 | conv_size.width = 320; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1404 | conv_size.height = 175; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1405 | conv_size.entry_height = 50; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1406 | |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1407 | buddy_chat_size.width = 320; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1408 | buddy_chat_size.height = 160; |
|
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1409 | buddy_chat_size.entry_height = 50; |
| 5631 | 1410 | #endif |
| 1 | 1411 | } |
| 1412 | ||
| 1413 | void load_prefs() | |
| 1414 | { | |
| 1415 | FILE *f; | |
| 1416 | char buf[1024]; | |
| 1417 | int ver = 0; | |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1418 | |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1419 | gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Loading preferences.\n"); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1420 | |
| 4137 | 1421 | if (is_saving_prefs) { |
| 1422 | request_load_prefs = 1; | |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1423 | gaim_debug(GAIM_DEBUG_INFO, "gaimrc", |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1424 | "Currently saving. Will request load.\n"); |
| 4137 | 1425 | return; |
| 1426 | } | |
|
570
3450eeb314a1
[gaim-migrate @ 580]
Todd Kulesza <fflewddur@users.sourceforge.net>
parents:
453
diff
changeset
|
1427 | |
| 8596 | 1428 | if (gaim_home_dir()) |
| 3630 | 1429 | g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir()); |
| 1560 | 1430 | else { |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1431 | set_defaults(); |
| 1560 | 1432 | return; |
| 1433 | } | |
| 1434 | ||
| 1435 | if ((f = fopen(buf, "r"))) { | |
| 4137 | 1436 | is_loading_prefs = 1; |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1437 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "start load_prefs\n"); |
| 1560 | 1438 | fgets(buf, sizeof(buf), f); |
| 1439 | sscanf(buf, "# .gaimrc v%d", &ver); | |
|
2389
fa35272e9c1a
[gaim-migrate @ 2402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2388
diff
changeset
|
1440 | if ((ver <= 3) || (buf[0] != '#')) |
|
2313
f7f7ff0b8d4a
[gaim-migrate @ 2323]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2286
diff
changeset
|
1441 | set_defaults(); |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1442 | |
| 1560 | 1443 | while (!feof(f)) { |
| 4137 | 1444 | int tag = gaimrc_parse_tag(f); |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1445 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1446 | "starting read tag %d\n", tag); |
| 4137 | 1447 | switch (tag) { |
| 1560 | 1448 | case -1: |
|
5514
19d19a5ddaff
[gaim-migrate @ 5913]
Mark Doliner <markdoliner@pidgin.im>
parents:
5442
diff
changeset
|
1449 | /* Do nothing--either EOF or empty line */ |
| 1560 | 1450 | break; |
| 1451 | case 0: | |
| 1452 | gaimrc_read_users(f); | |
| 1453 | break; | |
| 1454 | case 1: | |
| 1455 | gaimrc_read_options(f); | |
| 1456 | break; | |
| 1457 | case 2: | |
| 1458 | gaimrc_read_away(f); | |
| 1459 | break; | |
| 1460 | case 3: | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1461 | if (gaim_plugins_enabled()) |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1462 | gaimrc_read_plugins(f); |
| 1560 | 1463 | break; |
| 1464 | case 4: | |
| 1465 | gaimrc_read_pounce(f); | |
| 1466 | break; | |
| 1467 | case 6: | |
| 1468 | gaimrc_read_sounds(f); | |
| 1469 | break; | |
|
1881
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1470 | case 7: |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1471 | gaimrc_read_proxy(f); |
|
bcd5d457cdbb
[gaim-migrate @ 1891]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1878
diff
changeset
|
1472 | break; |
| 1560 | 1473 | default: |
| 1474 | /* NOOP */ | |
| 1475 | break; | |
| 1 | 1476 | } |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1477 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1478 | "ending read tag %d\n", tag); |
| 1 | 1479 | } |
| 1560 | 1480 | fclose(f); |
| 4137 | 1481 | is_loading_prefs = 0; |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1482 | gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "end load_prefs\n"); |
| 4137 | 1483 | if (request_save_prefs) { |
|
5211
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1484 | gaim_debug(GAIM_DEBUG_INFO, "gaimrc", |
|
94d9756c381f
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1485 | "Saving preferences on request\n"); |
| 4137 | 1486 | request_save_prefs = 0; |
| 1487 | } | |
|
2383
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1488 | } else { |
|
712503cc80ba
[gaim-migrate @ 2396]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2379
diff
changeset
|
1489 | set_defaults(); |
| 1 | 1490 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1491 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5109
diff
changeset
|
1492 | prefs_initial_load = 1; |
| 1 | 1493 | } |
| 1494 | ||
| 1495 | void save_prefs() | |
| 1496 | { | |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1497 | gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "save_prefs() called. Rejected!\n"); |
| 1 | 1498 | } |
| 1499 | ||
| 1209 | 1500 | |
| 7942 | 1501 | /* |
| 1502 | * This function is called by g_slist_insert_sorted to compare the item | |
| 1209 | 1503 | * being compared to the rest of the items on the list. |
| 1504 | */ | |
| 1505 | gint sort_awaymsg_list(gconstpointer a, gconstpointer b) | |
| 1506 | { | |
|
1250
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1507 | struct away_message *msg_a; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1508 | struct away_message *msg_b; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1509 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1510 | msg_a = (struct away_message *)a; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1511 | msg_b = (struct away_message *)b; |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1512 | |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1513 | return (strcmp(msg_a->name, msg_b->name)); |
|
46ac03911ab0
[gaim-migrate @ 1260]
Decklin Foster <decklin@red-bean.com>
parents:
1236
diff
changeset
|
1514 | |
| 1209 | 1515 | } |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1516 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1517 | void |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1518 | load_pounces() |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1519 | { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1520 | GList *l; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1521 | struct pounce_placeholder *ph; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5841
diff
changeset
|
1522 | GaimPounce *pounce; |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
1523 | GaimAccount *account; |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1524 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1525 | for (l = buddy_pounces; l != NULL; l = l->next) { |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1526 | GaimPounceEvent events = GAIM_POUNCE_NONE; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1527 | GaimGtkPounceAction actions = GAIM_GTKPOUNCE_NONE; |
| 7132 | 1528 | char buf[3]; |
| 1529 | ||
| 5035 | 1530 | ph = (struct pounce_placeholder *)l->data; |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1531 | |
| 7132 | 1532 | g_snprintf(buf, sizeof(buf), "%d", ph->protocol); |
| 1533 | account = gaim_accounts_find(ph->pouncer, buf); | |
|
5972
12590f3b80ad
[gaim-migrate @ 6419]
Mark Doliner <markdoliner@pidgin.im>
parents:
5943
diff
changeset
|
1534 | if (account == NULL) |
|
12590f3b80ad
[gaim-migrate @ 6419]
Mark Doliner <markdoliner@pidgin.im>
parents:
5943
diff
changeset
|
1535 | continue; |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1536 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1537 | old_pounce_opts_to_new(ph->options, &events, &actions); |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1538 | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5874
diff
changeset
|
1539 | pounce = gaim_pounce_new(GAIM_GTK_UI, account, ph->name, events); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1540 | |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1541 | gaim_pounce_action_set_enabled(pounce, "open-window", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1542 | (actions & GAIM_GTKPOUNCE_OPEN_WIN)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1543 | gaim_pounce_action_set_enabled(pounce, "popup-notify", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1544 | (actions & GAIM_GTKPOUNCE_POPUP)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1545 | gaim_pounce_action_set_enabled(pounce, "send-message", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1546 | (actions & GAIM_GTKPOUNCE_SEND_MSG)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1547 | gaim_pounce_action_set_enabled(pounce, "execute-command", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1548 | (actions & GAIM_GTKPOUNCE_EXEC_CMD)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1549 | gaim_pounce_action_set_enabled(pounce, "play-sound", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1550 | (actions & GAIM_GTKPOUNCE_PLAY_SOUND)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1551 | |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1552 | gaim_pounce_action_set_attribute(pounce, "send-message", "message", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1553 | (*ph->message == '\0' ? NULL : ph->message)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1554 | gaim_pounce_action_set_attribute(pounce, "execute-command", "command", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1555 | (*ph->sound == '\0' ? NULL : ph->message)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1556 | gaim_pounce_action_set_attribute(pounce, "play-sound", "filename", |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1557 | (*ph->sound == '\0' ? NULL : ph->message)); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1558 | |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1559 | gaim_pounce_set_save(pounce, (ph->options & 0x100)); |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1560 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1561 | g_free(ph); |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1562 | } |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1563 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1564 | g_list_free(buddy_pounces); |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1565 | buddy_pounces = NULL; |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1566 | |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1567 | /* |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1568 | * < ChipX86|Coding> why do we save prefs just after reading them? |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1569 | * < faceprint> ChipX86|Coding: because we're cool like that |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1570 | * <SeanEgan|Coding> damn straight |
|
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1571 | */ |
|
5593
eb9c0dcefade
[gaim-migrate @ 5997]
Christian Hammond <chipx86@chipx86.com>
parents:
5580
diff
changeset
|
1572 | /* save_prefs(); -- I like the above comment :( */ |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
4985
diff
changeset
|
1573 | } |