annotate src/gaimrc.c @ 6532:23a517088ebb

[gaim-migrate @ 7049] This should let --prefix= set the perl prefix dir, too. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 21 Aug 2003 01:22:47 +0000
parents 9dd4bb3cf1df
children 42fdf16f1dad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6321
diff changeset
21 #include "gtkinternal.h"
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
22
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
23 #include "account.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
24 #include "debug.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
25 #include "log.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
26 #include "notify.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
27 #include "pounce.h"
5442
702071b23c06 [gaim-migrate @ 5824]
Nathan Walp <nwalp@pidgin.im>
parents: 5440
diff changeset
28 #include "prefs.h"
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
29 #include "proxy.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
30 #include "prpl.h"
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
31 #include "sound.h"
6101
e4a5085fb870 [gaim-migrate @ 6560]
Mark Doliner <mark@kingant.net>
parents: 6098
diff changeset
32 #include "status.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
33 #include "ui.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
34 #include "util.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
35
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
36 #include "gaim.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
37
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
38 #include "gtkpounce.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5868
diff changeset
39 #include "gtksound.h"
6144
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
40 #include "gtkplugin.h"
6372
9dd4bb3cf1df [gaim-migrate @ 6877]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
41 #include "gtkutils.h"
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
42
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
43 /* for people like myself, who are too lazy to add an away msg :) */
4596
7e1591c6d0d8 [gaim-migrate @ 4881]
Luke Schierer <lschiere@pidgin.im>
parents: 4592
diff changeset
44 #define BORING_DEFAULT_AWAY_MSG _("sorry, i ran out for a while. bbl")
1139
ce935e673907 [gaim-migrate @ 1149]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
45 #define MAX_VALUES 10
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
47 #define OPT_FONT_BOLD 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
48 #define OPT_FONT_ITALIC 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
49 #define OPT_FONT_UNDERLINE 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
50 #define OPT_FONT_STRIKE 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
51 #define OPT_FONT_FACE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
52 #define OPT_FONT_FGCOL 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
53 #define OPT_FONT_BGCOL 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
54 #define OPT_FONT_SIZE 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
55
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
56 #define OPT_MISC_DEBUG 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
57 #define OPT_MISC_BROWSER_POPUP 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
58 #define OPT_MISC_BUDDY_TICKER 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
59 #define OPT_MISC_STEALTH_TYPING 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
60 #define OPT_MISC_USE_SERVER_ALIAS 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
61
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
62 #define OPT_LOG_CONVOS 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
63 #define OPT_LOG_STRIP_HTML 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
64 #define OPT_LOG_INDIVIDUAL 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
65 #define OPT_LOG_CHATS 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
66
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
67 #define OPT_BLIST_SHOW_GRPNUM 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
68 #define OPT_BLIST_SHOW_PIXMAPS 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
69 #define OPT_BLIST_SHOW_IDLETIME 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
70 #define OPT_BLIST_SHOW_BUTTON_XPM 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
71 #define OPT_BLIST_NO_BUTTON_TEXT 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
72 #define OPT_BLIST_NO_MT_GRP 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
73 #define OPT_BLIST_SHOW_WARN 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
74 #define OPT_BLIST_GREY_IDLERS 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
75 #define OPT_BLIST_POPUP 0x00001000
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
76 #define OPT_BLIST_SHOW_ICONS 0x00002000
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
77 #define OPT_BLIST_SHOW_OFFLINE 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
78
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
79 #define OPT_CONVO_ENTER_SENDS 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
80 #define OPT_CONVO_SEND_LINKS 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
81 #define OPT_CONVO_CHECK_SPELLING 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
82 #define OPT_CONVO_CTL_CHARS 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
83 #define OPT_CONVO_CTL_SMILEYS 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
84 #define OPT_CONVO_ESC_CAN_CLOSE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
85 #define OPT_CONVO_CTL_ENTER 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
86 #define OPT_CONVO_F2_TOGGLES 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
87 #define OPT_CONVO_SHOW_TIME 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
88 #define OPT_CONVO_IGNORE_COLOUR 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
89 #define OPT_CONVO_SHOW_SMILEY 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
90 #define OPT_CONVO_IGNORE_FONTS 0x00000800
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
91 #define OPT_CONVO_IGNORE_SIZES 0x00001000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
92 #define OPT_CONVO_COMBINE 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
93 #define OPT_CONVO_CTL_W_CLOSES 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
94 #define OPT_CONVO_NO_X_ON_TAB 0x00008000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
95
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
96 #define OPT_IM_POPUP 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
97 #define OPT_IM_LOGON 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
98 #define OPT_IM_BUTTON_TEXT 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
99 #define OPT_IM_BUTTON_XPM 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
100 #define OPT_IM_ONE_WINDOW 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
101 #define OPT_IM_SIDE_TAB 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
102 #define OPT_IM_BR_TAB 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
103 #define OPT_IM_HIDE_ICONS 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
104 #define OPT_IM_NO_ANIMATION 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
105 #define OPT_IM_ALIAS_TAB 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
106 #define OPT_IM_POPDOWN 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
107
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
108 #define OPT_CHAT_ONE_WINDOW 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
109 #define OPT_CHAT_BUTTON_TEXT 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
110 #define OPT_CHAT_BUTTON_XPM 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
111 #define OPT_CHAT_LOGON 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
112 #define OPT_CHAT_POPUP 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
113 #define OPT_CHAT_SIDE_TAB 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
114 #define OPT_CHAT_BR_TAB 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
115 #define OPT_CHAT_TAB_COMPLETE 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
116 #define OPT_CHAT_OLD_STYLE_TAB 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
117 #define OPT_CHAT_COLORIZE 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
118
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
119 #define OPT_SOUND_LOGIN 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
120 #define OPT_SOUND_LOGOUT 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
121 #define OPT_SOUND_RECV 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
122 #define OPT_SOUND_SEND 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
123 #define OPT_SOUND_FIRST_RCV 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
124 #define OPT_SOUND_WHEN_AWAY 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
125 #define OPT_SOUND_SILENT_SIGNON 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
126 #define OPT_SOUND_THROUGH_GNOME 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
127 #define OPT_SOUND_CHAT_JOIN 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
128 #define OPT_SOUND_CHAT_SAY 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
129 #define OPT_SOUND_BEEP 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
130 #define OPT_SOUND_CHAT_PART 0x00000800
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
131 #define OPT_SOUND_CHAT_YOU_SAY 0x00001000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
132 #define OPT_SOUND_NORMAL 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
133 #define OPT_SOUND_NAS 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
134 #define OPT_SOUND_ARTS 0x00008000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
135 #define OPT_SOUND_ESD 0x00010000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
136 #define OPT_SOUND_CMD 0x00020000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
137 #define OPT_SOUND_CHAT_NICK 0x00040000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
138
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
139 #define OPT_AWAY_BACK_ON_IM 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
140 #define OPT_AWAY_AUTO 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
141 #define OPT_AWAY_NO_AUTO_RESP 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
142 #define OPT_AWAY_QUEUE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
143 #define OPT_AWAY_IDLE_RESP 0x00000040
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
144 #define OPT_AWAY_QUEUE_UNREAD 0x00000080
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
145 #define OPT_AWAY_DELAY_IN_USE 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
146
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
147 #define OPT_ACCT_AUTO 0x00000001
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
148 /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
149 #define OPT_ACCT_REM_PASS 0x00000004
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
150 #define OPT_ACCT_MAIL_CHECK 0x00000008
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
151
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
152 #define IDLE_NONE 0
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
153 #define IDLE_GAIM 1
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
154 #define IDLE_SCREENSAVER 2
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
155
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
156 #define BROWSER_NETSCAPE 0
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
157 #define BROWSER_KONQ 1
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
158 #define BROWSER_MANUAL 2
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
159 /*#define BROWSER_INTERNAL 3*/
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
160 #define BROWSER_GNOME 4
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
161 #define BROWSER_OPERA 5
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
162 #define BROWSER_GALEON 6
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
163 #define BROWSER_MOZILLA 7
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
164
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
165
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
166 static guint misc_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
167 static guint logging_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
168 static guint blist_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
169 static guint convo_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
170 static guint im_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
171 static guint chat_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
172 static guint font_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
173 static guint sound_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
174 static guint away_options;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
175 static guint is_loading_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
176 static guint request_save_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
177 static guint is_saving_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
178 static guint request_load_prefs = 0;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
179 static guint prefs_initial_load = 0;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
180 guint proxy_info_is_from_gaimrc = 1; /* Only save proxy info if it
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
181 * was loaded from the file
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
182 * or otherwise explicitly requested */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184 struct parse {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
185 char option[256];
2286
f00bf9537bb7 [gaim-migrate @ 2296]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
186 char value[MAX_VALUES][4096];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
189 /*
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
190 * This is absolutely necessary, unfortunately. It is used to grab
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
191 * the information on the pounce, so that we can then later register
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
192 * them. The reason we do this (well, one of them) is because the buddy
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
193 * list isn't processed yet.
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
194 *
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
195 * -- ChipX86
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
196 */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
197 struct pounce_placeholder
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
198 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
199 char name[80];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
200 char message[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
201 char command[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
202 char sound[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
203 char pouncer[80];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
204
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
205 int protocol;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
206 int options;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
207 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
208
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
209 static GList *buddy_pounces = NULL;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
210
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
211 static struct parse *parse_line(char *line, struct parse *p)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
213 char *c = line;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
214 int inopt = 1, inval = 0, curval = -1;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
215 int optlen = 0, vallen = 0, last_non_space = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
216 int x;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
218 for (x = 0; x < MAX_VALUES; x++) {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
219 p->value[x][0] = 0;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
220 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
221
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
222 while (*c) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
223 if (*c == '\t') {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
224 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
225 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
226 }
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
227
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
228 if (inopt) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
229 if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
230 inopt = 0;
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
231 p->option[optlen] = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
235
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
236 p->option[optlen] = *c;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
237 optlen++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
238 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
239 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
240 } else if (inval) {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
241 if (*c == '\\') {
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
242 /* if we have a \ take the char after it literally.. */
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
243 c++;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
244 p->value[curval][vallen] = *c;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
245
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
246 vallen++;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
247 last_non_space = vallen;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
248 c++;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
249 continue;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
250 } else if (*c == '}') {
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
251 /* } that isn't escaped should end this chunk of data, and
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
252 * should have a space before it.. */
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
253 p->value[curval][last_non_space] = 0;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
254 inval = 0;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
255 c++;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
256 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
257 } else {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
258 p->value[curval][vallen] = *c;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
259
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
260 vallen++;
5109
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
261 if (isspace(*c))
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
262 last_non_space = vallen - 1;
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
263 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
264 last_non_space = vallen;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
265 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
266 continue;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
268 } else if (*c == '{') {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
269 /* i really don't think this if ever succeeds, but i'm
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
270 * not brave enough to take it out... */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
271 if (*(c - 1) == '\\') {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
272 p->value[curval][vallen] = *c;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
273 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
274 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
275 } else {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
276 /* { that isn't escaped should signify the start of a
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
277 * piece of data and should have a space after it.. */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
278 curval++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
279 vallen = 0;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
280 last_non_space = vallen;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
281 inval = 1;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
282 c++;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
283 while (*c && isspace(*c))
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
284 c++;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
285 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
286 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
287 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
288 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
289 }
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
290
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
291 return p;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 static int gaimrc_parse_tag(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 char buf[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 char tag[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 buf[0] = '#';
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 while (buf[0] == '#' && !feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 fgets(buf, sizeof(buf), f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 if (feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306
5514
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
307 if (sscanf(buf, "%s {", tag) != 1)
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
308 return -1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 if (!strcmp(tag, "users")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312 } else if (!strcmp(tag, "options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 return 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 } else if (!strcmp(tag, "away")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 return 2;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
316 } else if (!strcmp(tag, "plugins")) {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
317 return 3;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
318 } else if (!strcmp(tag, "pounce")) {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
319 return 4;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
320 } else if (!strcmp(tag, "sound_files")) {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
321 return 6;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
322 } else if (!strcmp(tag, "proxy")) {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
323 return 7;
4026
a997156437b6 [gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3924
diff changeset
324 } else if (!strcmp(tag, "wgaim")) {
a997156437b6 [gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3924
diff changeset
325 return 8;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 static void gaimrc_read_away(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
332 struct parse parse_buffer;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334 char buf[4096];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 struct away_message *a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
338
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
339 while (buf[0] != '}') {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341 return;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
342
6065
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6040
diff changeset
343 if (buf[0] == '}') {
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6040
diff changeset
344 gaim_status_sync();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 return;
6065
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6040
diff changeset
346 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
348 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
349 if (!strcmp(p->option, "message")) {
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
350 a = g_new0(struct away_message, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
352 g_snprintf(a->name, sizeof(a->name), "%s", p->value[0]);
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
353 g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]);
1209
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
354 away_messages = g_slist_insert_sorted(away_messages, a, sort_awaymsg_list);
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
355 }
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
356 /* auto { time } { default message } */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
357 else if (!strcmp(p->option, "auto")) {
6216
dc42b27101c0 [gaim-migrate @ 6702]
Nathan Walp <nwalp@pidgin.im>
parents: 6176
diff changeset
358 struct away_message *default_away;
5748
c6a30e1868ae [gaim-migrate @ 6173]
Nathan Walp <nwalp@pidgin.im>
parents: 5710
diff changeset
359 gaim_prefs_set_int("/core/away/mins_before_away",
c6a30e1868ae [gaim-migrate @ 6173]
Nathan Walp <nwalp@pidgin.im>
parents: 5710
diff changeset
360 atoi(p->value[0]));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2369
diff changeset
361 default_away = g_slist_nth_data(away_messages, atoi(p->value[1]));
6223
0eead37020bb [gaim-migrate @ 6716]
Luke Schierer <lschiere@pidgin.im>
parents: 6216
diff changeset
362 if (default_away)
0eead37020bb [gaim-migrate @ 6716]
Luke Schierer <lschiere@pidgin.im>
parents: 6216
diff changeset
363 gaim_prefs_set_string("/core/away/default_message",
0eead37020bb [gaim-migrate @ 6716]
Luke Schierer <lschiere@pidgin.im>
parents: 6216
diff changeset
364 default_away->name);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
365 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 }
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
367 if (!away_messages) {
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
368 a = g_new0(struct away_message, 1);
4589
eddb870a3c4d [gaim-migrate @ 4873]
Luke Schierer <lschiere@pidgin.im>
parents: 4581
diff changeset
369 g_snprintf(a->name, sizeof(a->name), _("boring default"));
6321
3613007cbb6e [gaim-migrate @ 6820]
Luke Schierer <lschiere@pidgin.im>
parents: 6223
diff changeset
370 g_snprintf(a->message, sizeof(a->message), "%s", _(BORING_DEFAULT_AWAY_MSG));
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
371 away_messages = g_slist_append(away_messages, a);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
372 }
6065
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6040
diff changeset
373 gaim_status_sync();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
376 /*
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
377 * This is temporary, and we're using it to translate the new event
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
378 * and action values into the old ones. We're also adding entries for
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
379 * new types, but if you go and use an older gaim, these will be nuked.
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
380 * When we have a better prefs system, this can go away.
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
381 *
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
382 * -- ChipX86
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
383 */
5864
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
384 typedef enum
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
385 {
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
386 GAIM_GTKPOUNCE_NONE = 0x00, /**< No action. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
387 GAIM_GTKPOUNCE_OPEN_WIN = 0x01, /**< Open an IM window. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
388 GAIM_GTKPOUNCE_POPUP = 0x02, /**< Popup notification. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
389 GAIM_GTKPOUNCE_SEND_MSG = 0x04, /**< Send a message. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
390 GAIM_GTKPOUNCE_EXEC_CMD = 0x08, /**< Execute a command. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
391 GAIM_GTKPOUNCE_PLAY_SOUND = 0x10 /**< Play a sound. */
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
392
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
393 } GaimGtkPounceAction;
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
394
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
395 static int pounce_evt_trans_table[] =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
396 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
397 0x010, GAIM_POUNCE_SIGNON,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
398 0x020, GAIM_POUNCE_AWAY_RETURN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
399 0x040, GAIM_POUNCE_IDLE_RETURN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
400 0x080, GAIM_POUNCE_TYPING,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
401 /* 0x100, save, is handled separately. */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
402 0x400, GAIM_POUNCE_SIGNOFF,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
403 0x800, GAIM_POUNCE_AWAY,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
404 0x1000, GAIM_POUNCE_IDLE,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
405 0x2000, GAIM_POUNCE_TYPING_STOPPED
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
406 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
407
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
408 static int pounce_act_trans_table[] =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
409 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
410 0x001, GAIM_GTKPOUNCE_OPEN_WIN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
411 0x002, GAIM_GTKPOUNCE_SEND_MSG,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
412 0x004, GAIM_GTKPOUNCE_EXEC_CMD,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
413 0x008, GAIM_GTKPOUNCE_PLAY_SOUND,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
414 /* 0x100, save, is handled separately. */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
415 0x200, GAIM_GTKPOUNCE_POPUP
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
416 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
417
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
418 static int pounce_evt_trans_table_size =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
419 (sizeof(pounce_evt_trans_table) / sizeof(*pounce_evt_trans_table));
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
420
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
421 static int pounce_act_trans_table_size =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
422 (sizeof(pounce_act_trans_table) / sizeof(*pounce_act_trans_table));
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
423
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
424 static void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
425 old_pounce_opts_to_new(int opts, GaimPounceEvent *events,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
426 GaimGtkPounceAction *actions)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
427 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
428 int i;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
429
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
430 *events = 0;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
431 *actions = 0;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
432
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
433 /* First, convert events */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
434 for (i = 0; i < pounce_evt_trans_table_size; i += 2)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
435 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
436 int evt = pounce_evt_trans_table[i];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
437
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
438 if ((opts & evt) == evt)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
439 *events |= pounce_evt_trans_table[i + 1];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
440 }
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
441
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
442 for (i = 0; i < pounce_act_trans_table_size; i += 2)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
443 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
444 int act = pounce_act_trans_table[i];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
445
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
446 if ((opts & act) == act)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
447 *actions |= pounce_act_trans_table[i + 1];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
448
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
449 }
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
450 }
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
451
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
452 static void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
453 gaimrc_read_pounce(FILE *f)
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
454 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
455 struct parse parse_buffer;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
456 struct parse *p;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
457 char buf[4096];
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
458 struct pounce_placeholder *b;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
459
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
460 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
461
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
462 while (buf[0] != '}') {
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
463 if (!fgets(buf, sizeof(buf), f))
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
464 return;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
465
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
466 if (buf[0] == '}')
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
467 return;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
468
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
469 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
470 if (!strcmp(p->option, "entry")) {
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
471 b = g_new0(struct pounce_placeholder, 1);
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
472
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
473 g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]);
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1139
diff changeset
474 g_snprintf(b->message, sizeof(b->message), "%s", p->value[1]);
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1214
diff changeset
475 g_snprintf(b->command, sizeof(b->command), "%s", p->value[2]);
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
476
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
477 b->options = atoi(p->value[3]);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
478
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
479 g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[4]);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
480 b->protocol = atoi(p->value[5]);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
481
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1560
diff changeset
482 g_snprintf(b->sound, sizeof(b->sound), "%s", p->value[6]);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2369
diff changeset
483
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
484 buddy_pounces = g_list_append(buddy_pounces, b);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
485 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
486 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
487 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
488
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
489 static void gaimrc_read_plugins(FILE *f)
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
490 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
491 struct parse parse_buffer;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
492 struct parse *p;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
493 char buf[4096];
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
494
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
495 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
496
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
497 while (buf[0] != '}') {
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
498 if (!fgets(buf, sizeof(buf), f))
1236
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
499 break;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
500
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
501 if (buf[0] == '}')
1236
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
502 break;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
503
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
504 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
505 if (!strcmp(p->option, "plugin")) {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
506 gaim_plugin_load(gaim_plugin_probe(p->value[0]));
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
507 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
508 }
6144
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
509 gaim_gtk_plugins_save();
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
510 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
512 static GaimAccount *gaimrc_read_user(FILE *f)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
514 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
515 struct parse *p;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
516 GaimAccount *account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
517 int i;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
518 char buf[4096];
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
519 char user_info[2048];
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
520 int flags;
5618
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
521 char *tmp;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
523 if (!fgets(buf, sizeof(buf), f))
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
524 return NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
526 p = parse_line(buf, &parse_buffer);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
528 if (strcmp(p->option, "ident"))
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
529 return NULL;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
530
6067
6a3b676eb36a [gaim-migrate @ 6517]
Nathan Walp <nwalp@pidgin.im>
parents: 6065
diff changeset
531 account = gaim_account_new(p->value[0], NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
533 gaim_account_set_password(account, p->value[1]);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
534 gaim_account_set_remember_password(account, TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535
5710
dbac958d8937 [gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents: 5691
diff changeset
536 gaim_accounts_add(account);
dbac958d8937 [gaim-migrate @ 6131]
Christian Hammond <chipx86@chipx86.com>
parents: 5691
diff changeset
537
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
538 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
539 return account;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
541 if (strcmp(buf, "\t\tuser_info {\n")) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
542 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
543 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
545 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
546 return account;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
548 *user_info = '\0';
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
549
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
550 while (strncmp(buf, "\t\t}", 3)) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
551 if (strlen(buf) > 3)
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
552 strcat(user_info, buf + 3);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
554 if (!fgets(buf, sizeof(buf), f)) {
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
555 gaim_account_set_user_info(account, user_info);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
556
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
557 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
558 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
559 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560
5568
fb4f7bd7525c [gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
561 if ((i = strlen(user_info)))
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
562 user_info[i - 1] = '\0';
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
563
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
564 if (*user_info != '.')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
565 gaim_account_set_user_info(account, user_info);
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1264
diff changeset
566
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
567 if (!fgets(buf, sizeof(buf), f)) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
568 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
569 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
570
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
571 if (!strcmp(buf, "\t}")) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
572 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
573 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
574
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
575 p = parse_line(buf, &parse_buffer);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
576
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
577 if (strcmp(p->option, "user_opts"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
578 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
579
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
580 flags = atoi(p->value[0]);
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
581
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
582 if (flags & OPT_ACCT_AUTO)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
583 gaim_account_set_auto_login(account, GAIM_GTK_UI, TRUE);
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
584
5659
6b3214ab8632 [gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents: 5655
diff changeset
585 if (flags & OPT_ACCT_MAIL_CHECK)
6b3214ab8632 [gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents: 5655
diff changeset
586 gaim_account_set_check_mail(account, TRUE);
6b3214ab8632 [gaim-migrate @ 6073]
Christian Hammond <chipx86@chipx86.com>
parents: 5655
diff changeset
587
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
588 if (!(flags & OPT_ACCT_REM_PASS))
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
589 gaim_account_set_remember_password(account, FALSE);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
590
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
591 gaim_account_set_protocol(account, atoi(p->value[1]));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
592
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
593 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
594 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
595
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
596 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
597 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
598
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
599 p = parse_line(buf, &parse_buffer);
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
600
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
601 if (strcmp(p->option, "proto_opts"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
602 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
603
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
604 /* I hate this part. We must convert the protocol options. */
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
605 switch (gaim_account_get_protocol(account)) {
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
606 /* TOC */
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
607 case GAIM_PROTO_TOC:
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
608 if (*p->value[0] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
609 gaim_account_set_string(account, "server", "toc.oscar.aol.com");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
610 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
611 gaim_account_set_string(account, "server", p->value[0]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
612
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
613 if (*p->value[1] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
614 gaim_account_set_int(account, "port", 9898);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
615 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
616 gaim_account_set_int(account, "port", atoi(p->value[1]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
617
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
618 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
619
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
620 /* OSCAR */
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
621 case GAIM_PROTO_OSCAR:
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
622 if (*p->value[0] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
623 gaim_account_set_string(account, "server",
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
624 "login.oscar.aol.com");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
625 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
626 gaim_account_set_string(account, "server", p->value[0]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
627
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
628 if (*p->value[1] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
629 gaim_account_set_int(account, "port", 5190);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
630 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
631 gaim_account_set_int(account, "port", atoi(p->value[1]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
632
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
633 break;
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
634
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
635 /* Jabber */
5612
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
636 case GAIM_PROTO_JABBER:
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
637 if (*p->value[0] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
638 gaim_account_set_int(account, "port", 5222);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
639 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
640 gaim_account_set_int(account, "port", atoi(p->value[0]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
641
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
642 if (*p->value[1] != '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
643 gaim_account_set_string(account, "connect_server", p->value[1]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
644
5612
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
645 break;
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
646
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
647 /* Napster */
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
648 case GAIM_PROTO_NAPSTER:
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
649 if (*p->value[3] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
650 gaim_account_set_string(account, "server", "64.124.41.187");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
651 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
652 gaim_account_set_string(account, "server", p->value[3]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
653
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
654 if (*p->value[4] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
655 gaim_account_set_int(account, "port", 8888);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
656 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
657 gaim_account_set_int(account, "port", atoi(p->value[4]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
658
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
659 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
660
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
661 /* Yahoo! */
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
662 case GAIM_PROTO_YAHOO:
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
663 if (*p->value[3] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
664 gaim_account_set_string(account, "server", "scs.yahoo.com");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
665 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
666 gaim_account_set_string(account, "server", p->value[3]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
667
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
668 if (*p->value[4] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
669 gaim_account_set_int(account, "port", 5050);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
670 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
671 gaim_account_set_int(account, "port", atoi(p->value[4]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
672
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
673 break;
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
674
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
675 /* MSN */
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
676 case GAIM_PROTO_MSN:
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
677 if (*p->value[3] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
678 gaim_account_set_string(account, "server",
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
679 "messenger.hotmail.com");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
680 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
681 gaim_account_set_string(account, "server", p->value[3]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
682
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
683 if (*p->value[4] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
684 gaim_account_set_int(account, "port", 1863);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
685 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
686 gaim_account_set_int(account, "port", atoi(p->value[4]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
687
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
688 break;
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
689
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
690 /* IRC */
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
691 case GAIM_PROTO_IRC:
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
692 if (*p->value[0] != '\0' &&
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
693 strchr(gaim_account_get_username(account), '@') == NULL) {
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
694
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
695 tmp = g_strdup_printf("%s@%s",
6176
aa806c22fb40 [gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents: 6175
diff changeset
696 gaim_account_get_username(account),
aa806c22fb40 [gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents: 6175
diff changeset
697 (!strcmp(p->value[0], "irc.openprojects.net")
aa806c22fb40 [gaim-migrate @ 6661]
Christian Hammond <chipx86@chipx86.com>
parents: 6175
diff changeset
698 ? "irc.freenode.net" : p->value[0]));
5618
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
699 gaim_account_set_username(account, tmp);
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
700 g_free(tmp);
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
701 }
6175
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
702
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
703 if (*p->value[1] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
704 gaim_account_set_int(account, "port", 6667);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
705 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
706 gaim_account_set_int(account, "port", atoi(p->value[1]));
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
707
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
708 if (*p->value[2] == '\0')
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
709 gaim_account_set_string(account, "charset", "ISO-8859-1");
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
710 else
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
711 gaim_account_set_string(account, "charset", p->value[2]);
a97b47ff5a7e [gaim-migrate @ 6660]
Christian Hammond <chipx86@chipx86.com>
parents: 6144
diff changeset
712
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
713 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
714
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
715 default:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
716 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
717 }
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
718
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
719 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
720 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
721
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
722 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
723 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
724
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
725 p = parse_line(buf, &parse_buffer);
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
726
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
727 if (strcmp(p->option, "iconfile"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
728 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
729
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
730 if (*p->value[0] != '\n' && *p->value[0] != '\0')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
731 gaim_account_set_buddy_icon(account, p->value[0]);
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
732
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
733 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
734 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
735
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
736 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
737 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
738
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
739 p = parse_line(buf, &parse_buffer);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
740
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
741 if (strcmp(p->option, "alias"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
742 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
743
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
744 if (*p->value[0] != '\n' && *p->value[0] != '\0')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
745 gaim_account_set_alias(account, p->value[0]);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
746
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
747 if (!fgets(buf, sizeof(buf), f))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
748 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
749
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
750 if (!strcmp(buf, "\t}"))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
751 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
752
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
753 p = parse_line(buf, &parse_buffer);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
754
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
755 if (strcmp(p->option, "proxy_opts"))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
756 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
757
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
758 if(atoi(p->value[0]) != GAIM_PROXY_USE_GLOBAL) {
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
759 GaimProxyInfo *info;
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
760
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
761 info = gaim_proxy_info_new();
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
762 gaim_proxy_info_set_type(info, atoi(p->value[0]));
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
763 gaim_proxy_info_set_host(info, p->value[1]);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
764 gaim_proxy_info_set_port(info, atoi(p->value[2]));
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
765 gaim_proxy_info_set_username(info, p->value[3]);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
766 gaim_proxy_info_set_password(info, p->value[4]);
5868
d048e5f2af27 [gaim-migrate @ 6299]
Nathan Walp <nwalp@pidgin.im>
parents: 5864
diff changeset
767
d048e5f2af27 [gaim-migrate @ 6299]
Nathan Walp <nwalp@pidgin.im>
parents: 5864
diff changeset
768 gaim_account_set_proxy_info(account, info);
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
769 }
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
770
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
771 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
772
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775 static void gaimrc_read_users(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777 char buf[2048];
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
778 GaimAccount *account = NULL;
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
779 struct parse parse_buffer;
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
780 struct parse *p=NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782 buf[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
784 while (fgets(buf, sizeof(buf), f)) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786 continue;
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
787 else if(buf[0] == '}')
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
788 break;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
789
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
790 p = parse_line(buf, &parse_buffer);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
792 if (strcmp(p->option, "user")==0 ||
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
793 strcmp(p->option, "current_user")==0) {
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
794 if((account=gaimrc_read_user(f))==NULL) {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
795 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
796 "Error reading in users from .gaimrc\n");
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
797 return;
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
798 }
159
d56878f647fb [gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
799 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
803 struct replace {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
804 int old;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
805 guint *val;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
806 int new;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
807 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
808
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
809 #define OPT_GEN_ENTER_SENDS 0x00000001
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
810 #define OPT_GEN_LOG_ALL 0x00000004
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
811 #define OPT_GEN_STRIP_HTML 0x00000008
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
812 #define OPT_GEN_POPUP_WINDOWS 0x00000020
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
813 #define OPT_GEN_SEND_LINKS 0x00000040
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
814 #define OPT_GEN_DEBUG 0x00000100
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
815 #define OPT_GEN_BROWSER_POPUP 0x00000800
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
816 #define OPT_GEN_CHECK_SPELLING 0x00008000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
817 #define OPT_GEN_POPUP_CHAT 0x00010000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
818 #define OPT_GEN_BACK_ON_IM 0x00020000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
819 #define OPT_GEN_CTL_CHARS 0x00080000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
820 #define OPT_GEN_CTL_SMILEYS 0x00200000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
821 #define OPT_GEN_AUTO_AWAY 0x00800000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
822 #define OPT_GEN_ESC_CAN_CLOSE 0x01000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
823 #define OPT_GEN_CTL_ENTER 0x02000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
824 #define OPT_GEN_F2_TOGGLES 0x04000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
825 #define OPT_GEN_NO_AUTO_RESP 0x08000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
826 #define OPT_GEN_QUEUE_WHEN_AWAY 0x10000000
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
827
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
828 #define OPT_DISP_SHOW_TIME 0x00000001
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
829 #define OPT_DISP_SHOW_GRPNUM 0x00000002
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
830 #define OPT_DISP_SHOW_IDLETIME 0x00000008
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
831 #define OPT_DISP_SHOW_BUTTON_XPM 0x00000010
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
832 #define OPT_DISP_IGNORE_COLOUR 0x00000020
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
833 #define OPT_DISP_SHOW_LOGON 0x00000040
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
834 #define OPT_DISP_SHOW_SMILEY 0x00000100
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
835 #define OPT_DISP_CHAT_LOGON 0x00000800
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
836 #define OPT_DISP_NO_BUTTONS 0x00002000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
837 #define OPT_DISP_CONV_BUTTON_TEXT 0x00004000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
838 #define OPT_DISP_CHAT_BUTTON_TEXT 0x00008000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
839 #define OPT_DISP_NO_MT_GRP 0x00040000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
840 #define OPT_DISP_CONV_BUTTON_XPM 0x00080000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
841 #define OPT_DISP_CHAT_BUTTON_XPM 0x00100000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
842 #define OPT_DISP_SHOW_WARN 0x00200000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
843 #define OPT_DISP_IGNORE_FONTS 0x00400000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
844 #define OPT_DISP_IGNORE_SIZES 0x00800000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
845 #define OPT_DISP_ONE_CHAT_WINDOW 0x02000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
846 #define OPT_DISP_CONV_SIDE_TAB 0x04000000
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
847 #define OPT_DISP_CONV_BR_TAB 0x08000000
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849 static void gaimrc_read_options(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
850 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
851 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
852 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
853 struct parse *p;
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
854 gboolean read_logging = FALSE, read_general = FALSE;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
855 int general_options = 0, display_options = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
856
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
857 buf[0] = 0;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
858
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
859 while (buf[0] != '}') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
860 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
861 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
862
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
863 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
864 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
865
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
866 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
867
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
868 /* XXX: what are we going to do about ancient prefs? */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
869 if (!strcmp(p->option, "general_options")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
870 general_options = atoi(p->value[0]);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
871 read_general = TRUE;
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
872 gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
873 general_options & OPT_GEN_ENTER_SENDS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
874 gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
875 general_options & OPT_GEN_POPUP_WINDOWS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
876 gaim_prefs_set_bool("/core/conversations/send_urls_as_links",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
877 general_options & OPT_GEN_SEND_LINKS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
878 gaim_prefs_set_bool("/gaim/gtk/debug/enabled",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
879 general_options & OPT_GEN_DEBUG);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
880 gaim_prefs_set_bool("/gaim/gtk/browsers/new_window",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
881 general_options & OPT_GEN_BROWSER_POPUP);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
882 gaim_prefs_set_bool("/gaim/gtk/conversations/spellecheck",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
883 general_options & OPT_GEN_CHECK_SPELLING);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
884 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
885 general_options & OPT_GEN_POPUP_CHAT);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
886 gaim_prefs_set_bool("/core/conversations/away_back_on_send",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
887 general_options & OPT_GEN_BACK_ON_IM);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
888 gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
889 general_options & OPT_GEN_CTL_CHARS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
890 gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
891 general_options & OPT_GEN_CTL_SMILEYS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
892 gaim_prefs_set_bool("/core/away/away_when_idle",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
893 general_options & OPT_GEN_AUTO_AWAY);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
894 gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
895 general_options & OPT_GEN_ESC_CAN_CLOSE);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
896 gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
897 general_options & OPT_GEN_CTL_ENTER);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
898 gaim_prefs_set_bool("/core/away/auto_response/enabled",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
899 !(general_options & OPT_GEN_NO_AUTO_RESP));
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
900 gaim_prefs_set_bool("/gaim/gtk/away/queu_messages",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
901 general_options & OPT_AWAY_QUEUE);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
902 } else if (!strcmp(p->option, "display_options")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
903 display_options = atoi(p->value[0]);
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
904 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
905 display_options & OPT_DISP_SHOW_TIME);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
906 gaim_prefs_set_bool("/gaim/gtk/blist/show_group_count",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
907 display_options & OPT_DISP_SHOW_GRPNUM);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
908 gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
909 display_options & OPT_DISP_SHOW_IDLETIME);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
910 gaim_prefs_set_int("/gaim/gtk/blist/button_style",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
911 ((display_options & OPT_DISP_SHOW_BUTTON_XPM)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
912 ? ((display_options & OPT_DISP_NO_BUTTONS)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
913 ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
914 : ((display_options & OPT_DISP_NO_BUTTONS)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
915 ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT)));
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
916 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_colors",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
917 display_options & OPT_DISP_IGNORE_COLOUR);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
918 gaim_prefs_set_bool("/core/conversations/im/show_login",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
919 display_options & OPT_DISP_SHOW_LOGON);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
920 gaim_prefs_set_bool("/gaim/gtk/conversations/show_smileys",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
921 display_options & OPT_DISP_SHOW_SMILEY);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
922 gaim_prefs_set_bool("/core/conversations/chat/show_join",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
923 display_options & OPT_DISP_CHAT_LOGON);
5889
466e0103ff8b [gaim-migrate @ 6321]
Christian Hammond <chipx86@chipx86.com>
parents: 5875
diff changeset
924 gaim_prefs_set_int("/gaim/gtk/conversations/im/button_type",
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
925 ((display_options & OPT_DISP_CONV_BUTTON_XPM)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
926 ? ((display_options & OPT_DISP_CONV_BUTTON_TEXT)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
927 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
928 : ((display_options & OPT_DISP_CONV_BUTTON_TEXT)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
929 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE)));
5889
466e0103ff8b [gaim-migrate @ 6321]
Christian Hammond <chipx86@chipx86.com>
parents: 5875
diff changeset
930 gaim_prefs_set_int("/gaim/gtk/conversations/chat/button_type",
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
931 ((display_options & OPT_DISP_CHAT_BUTTON_XPM)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
932 ? ((display_options & OPT_DISP_CHAT_BUTTON_TEXT)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
933 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
934 : ((display_options & OPT_DISP_CHAT_BUTTON_TEXT)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
935 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE)));
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
936 gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
937 display_options & OPT_DISP_SHOW_WARN);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
938 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_fonts",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
939 display_options & OPT_DISP_IGNORE_FONTS);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
940 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_font_sizes",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
941 display_options & OPT_DISP_IGNORE_SIZES);
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
942 gaim_prefs_set_int("/gaim/gtk/conversations/tab_side",
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
943 ((display_options & OPT_DISP_CONV_SIDE_TAB)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
944 ? ((display_options & OPT_DISP_CONV_BR_TAB)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
945 ? GTK_POS_RIGHT : GTK_POS_LEFT)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
946 : ((display_options & OPT_DISP_CONV_BR_TAB)
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
947 ? GTK_POS_BOTTOM : GTK_POS_TOP)));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
948 } else if (!strcmp(p->option, "misc_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
949 misc_options = atoi(p->value[0]);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
950 gaim_prefs_set_bool("/gaim/gtk/debug/enabled",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
951 misc_options & OPT_MISC_DEBUG);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
952 gaim_prefs_set_bool("/gaim/gtk/browsers/new_window",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
953 misc_options & OPT_MISC_BROWSER_POPUP);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
954 gaim_prefs_set_bool("/gaim/gtk/conversations/im/send_typing",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
955 !(misc_options & OPT_MISC_STEALTH_TYPING));
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
956 gaim_prefs_set_bool("/gaim/gtk/buddies/use_server_alias",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
957 misc_options & OPT_MISC_USE_SERVER_ALIAS);
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
958 } else if (!strcmp(p->option, "logging_options")) {
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
959 logging_options = atoi(p->value[0]);
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
960 read_logging = TRUE;
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
961 gaim_prefs_set_bool("/gaim/gtk/logging/log_ims",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
962 logging_options & OPT_LOG_CONVOS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
963 gaim_prefs_set_bool("/gaim/gtk/logging/strip_html",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
964 logging_options & OPT_LOG_STRIP_HTML);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
965 gaim_prefs_set_bool("/gaim/gtk/logging/individual_logs",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
966 logging_options & OPT_LOG_INDIVIDUAL);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
967 gaim_prefs_set_bool("/gaim/gtk/logging/log_chats",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
968 logging_options & OPT_LOG_CHATS);
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
969 gaim_prefs_set_bool("/gaim/gtk/logging/log_signon_signoff",
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
970 logging_options & OPT_LOG_BUDDY_SIGNON);
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
971 gaim_prefs_set_bool("/gaim/gtk/logging/log_idle_state",
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
972 logging_options & OPT_LOG_BUDDY_IDLE);
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
973 gaim_prefs_set_bool("/gaim/gtk/logging/log_away_state",
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
974 logging_options & OPT_LOG_BUDDY_AWAY);
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
975 gaim_prefs_set_bool("/gaim/gtk/logging/log_own_states",
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
976 logging_options & OPT_LOG_MY_SIGNON);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
977 } else if (!strcmp(p->option, "blist_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
978 blist_options = atoi(p->value[0]);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
979 gaim_prefs_set_bool("/gaim/gtk/blist/show_group_count",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
980 blist_options & OPT_BLIST_SHOW_GRPNUM);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
981 gaim_prefs_set_bool("/gaim/gtk/blist/show_idle_time",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
982 blist_options & OPT_BLIST_SHOW_IDLETIME);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
983 gaim_prefs_set_bool("/gaim/gtk/blist/show_empty_groups",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
984 !(blist_options & OPT_BLIST_NO_MT_GRP));
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
985 gaim_prefs_set_bool("/gaim/gtk/blist/show_warning_level",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
986 blist_options & OPT_BLIST_SHOW_WARN);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
987 gaim_prefs_set_bool("/gaim/gtk/blist/grey_idle_buddies",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
988 blist_options & OPT_BLIST_GREY_IDLERS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
989 gaim_prefs_set_bool("/gaim/gtk/blist/raise_on_events",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
990 blist_options & OPT_BLIST_POPUP);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
991 gaim_prefs_set_bool("/gaim/gtk/blist/show_buddy_icons",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
992 blist_options & OPT_BLIST_SHOW_ICONS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
993 gaim_prefs_set_bool("/gaim/gtk/blist/show_offline_buddies",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
994 blist_options & OPT_BLIST_SHOW_OFFLINE);
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
995 gaim_prefs_set_int("/gaim/gtk/blist/button_style",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
996 ((blist_options & OPT_BLIST_SHOW_BUTTON_XPM)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
997 ? ((blist_options & OPT_BLIST_NO_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
998 ? GAIM_BUTTON_IMAGE : GAIM_BUTTON_TEXT_IMAGE)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
999 : ((blist_options & OPT_BLIST_NO_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1000 ? GAIM_BUTTON_NONE : GAIM_BUTTON_TEXT)));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1001 } else if (!strcmp(p->option, "convo_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1002 convo_options = atoi(p->value[0]);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1003 gaim_prefs_set_bool("/gaim/gtk/conversations/enter_sends",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1004 convo_options & OPT_CONVO_ENTER_SENDS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1005 gaim_prefs_set_bool("/core/conversations/send_urls_as_links",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1006 convo_options & OPT_CONVO_SEND_LINKS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1007 gaim_prefs_set_bool("/gaim/gtk/conversations/spellcheck",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1008 convo_options & OPT_CONVO_CHECK_SPELLING);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1009 gaim_prefs_set_bool("/gaim/gtk/conversations/html_shortcuts",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1010 convo_options & OPT_CONVO_CTL_CHARS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1011 gaim_prefs_set_bool("/gaim/gtk/conversations/smiley_shortcuts",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1012 convo_options & OPT_CONVO_CTL_SMILEYS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1013 gaim_prefs_set_bool("/gaim/gtk/conversations/escape_closes",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1014 convo_options & OPT_CONVO_ESC_CAN_CLOSE);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1015 gaim_prefs_set_bool("/gaim/gtk/conversations/ctrl_enter_sends",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1016 convo_options & OPT_CONVO_CTL_ENTER);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1017 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1018 convo_options & OPT_CONVO_SHOW_TIME);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1019 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_colors",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1020 convo_options & OPT_CONVO_IGNORE_COLOUR);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1021 gaim_prefs_set_bool("/gaim/gtk/conversations/show_smileys",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1022 convo_options & OPT_CONVO_SHOW_SMILEY);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1023 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_fonts",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1024 convo_options & OPT_CONVO_IGNORE_FONTS);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1025 gaim_prefs_set_bool("/gaim/gtk/conversations/ignore_font_sizes",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1026 convo_options & OPT_CONVO_IGNORE_SIZES);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1027 gaim_prefs_set_bool("/core/conversations/combine_chat_im",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1028 convo_options & OPT_CONVO_COMBINE);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1029 gaim_prefs_set_bool("/gaim/gtk/conversations/close_on_tabs",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1030 !(convo_options & OPT_CONVO_NO_X_ON_TAB));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1031 } else if (!strcmp(p->option, "im_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1032 im_options = atoi(p->value[0]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1033
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1034 gaim_prefs_set_bool("/gaim/gtk/conversations/im/raise_on_events",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1035 im_options & OPT_IM_POPUP);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1036 gaim_prefs_set_bool("/core/conversations/im/show_login",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1037 im_options & OPT_IM_LOGON);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1038 gaim_prefs_set_bool("/gaim/gtk/conversations/im/button_type",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1039 ((im_options & OPT_IM_BUTTON_XPM)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1040 ? ((im_options & OPT_IM_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1041 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1042 : ((im_options & OPT_IM_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1043 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE)));
5667
18f7a2abc3fc [gaim-migrate @ 6084]
Nathan Walp <nwalp@pidgin.im>
parents: 5659
diff changeset
1044 gaim_prefs_set_int("/gaim/gtk/conversations/tab_side",
18f7a2abc3fc [gaim-migrate @ 6084]
Nathan Walp <nwalp@pidgin.im>
parents: 5659
diff changeset
1045 ((im_options & OPT_IM_SIDE_TAB)
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1046 ? ((im_options & OPT_IM_BR_TAB)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1047 ? GTK_POS_RIGHT : GTK_POS_LEFT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1048 : ((im_options & OPT_IM_BR_TAB)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1049 ? GTK_POS_BOTTOM : GTK_POS_TOP)));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1050 gaim_prefs_set_bool("/gaim/gtk/conversations/im/show_buddy_icons",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1051 !(im_options & OPT_IM_HIDE_ICONS));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1052 gaim_prefs_set_bool("/gaim/gtk/conversations/im/animate_buddy_icons",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1053 !(im_options & OPT_IM_NO_ANIMATION));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1054 gaim_prefs_set_bool("/core/conversations/use_alias_for_title",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1055 im_options & OPT_IM_ALIAS_TAB);
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1056 gaim_prefs_set_bool("/gaim/gtk/conversations/im/hide_on_send",
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1057 (im_options & OPT_IM_POPDOWN));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1058
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
1059 } else if (!strcmp(p->option, "conv_placement")) {
5858
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1060 switch(atoi(p->value[0])) {
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1061 case 1:
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1062 gaim_prefs_set_string("/core/conversations/placement",
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1063 "new");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1064 break;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1065 case 2:
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1066 gaim_prefs_set_string("/core/conversations/placement",
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1067 "group");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1068 break;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1069 case 3:
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1070 gaim_prefs_set_string("/core/conversations/placement",
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1071 "account");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1072 break;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1073 case 0:
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1074 default:
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1075 gaim_prefs_set_string("/core/conversations/placement",
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1076 "last");
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1077 break;
96e5b32e75ad [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5857
diff changeset
1078 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1079 } else if (!strcmp(p->option, "chat_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1080 chat_options = atoi(p->value[0]);
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1081
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1082 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/button_type",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1083 ((chat_options & OPT_CHAT_BUTTON_XPM)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1084 ? ((chat_options & OPT_CHAT_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1085 ? GAIM_BUTTON_TEXT_IMAGE : GAIM_BUTTON_IMAGE)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1086 : ((chat_options & OPT_CHAT_BUTTON_TEXT)
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1087 ? GAIM_BUTTON_TEXT : GAIM_BUTTON_NONE)));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1088 gaim_prefs_set_bool("/core/conversations/chat/show_join",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1089 chat_options & OPT_CHAT_LOGON);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1090 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/raise_on_events",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1091 chat_options & OPT_CHAT_POPUP);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1092 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/tab_completion",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1093 chat_options & OPT_CHAT_TAB_COMPLETE);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1094 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/old_tab_complete",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1095 chat_options & OPT_CHAT_OLD_STYLE_TAB);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1096 gaim_prefs_set_bool("/gaim/gtk/conversations/chat/color_nicks",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1097 chat_options & OPT_CHAT_COLORIZE);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1098
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1099 } else if (!strcmp(p->option, "font_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1100 font_options = atoi(p->value[0]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1101
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1102 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1103 font_options & OPT_FONT_BOLD);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1104 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1105 font_options & OPT_FONT_ITALIC);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1106 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1107 font_options & OPT_FONT_UNDERLINE);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1108 gaim_prefs_set_bool("/gaim/gtk/conversations/send_strikethrough",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1109 font_options & OPT_FONT_STRIKE);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1110 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_font",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1111 font_options & OPT_FONT_FACE);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1112 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_size",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1113 font_options & OPT_FONT_SIZE);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1114 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_fgcolor",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1115 font_options & OPT_FONT_FGCOL);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1116 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_bgcolor",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1117 font_options & OPT_FONT_BGCOL);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1118
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1119 } else if (!strcmp(p->option, "sound_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1120 sound_options = atoi(p->value[0]);
5691
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1121 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/login",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1122 sound_options & OPT_SOUND_LOGIN);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1123 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/logout",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1124 sound_options & OPT_SOUND_LOGOUT);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1125 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/im_recv",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1126 sound_options & OPT_SOUND_RECV);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1127 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_im",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1128 sound_options & OPT_SOUND_SEND);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1129 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/first_im_recv",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1130 sound_options & OPT_SOUND_FIRST_RCV);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1131 gaim_prefs_set_bool("/core/sound/when_away",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1132 sound_options & OPT_SOUND_WHEN_AWAY);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1133 gaim_prefs_set_bool("/gaim/gtk/sound/silent_signon",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1134 sound_options & OPT_SOUND_SILENT_SIGNON);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1135 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/join_chat",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1136 sound_options & OPT_SOUND_CHAT_JOIN);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1137 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/chat_msg_recv",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1138 sound_options & OPT_SOUND_CHAT_SAY);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1139 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/left_chat",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1140 sound_options & OPT_SOUND_CHAT_PART);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1141 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/send_chat_msg",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1142 sound_options & OPT_SOUND_CHAT_YOU_SAY);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1143 gaim_prefs_set_bool("/gaim/gtk/sound/enabled/nick_said",
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1144 sound_options & OPT_SOUND_CHAT_NICK);
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1145 if(sound_options & OPT_SOUND_NAS) {
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1146 gaim_prefs_set_string("/gaim/gtk/sound/method", "nas");
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1147 } else if(!(sound_options & OPT_SOUND_NORMAL)) {
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1148 if(sound_options & OPT_SOUND_ESD)
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1149 gaim_prefs_set_string("/gaim/gtk/sound/method", "esd");
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1150 else if(sound_options & OPT_SOUND_ARTS)
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1151 gaim_prefs_set_string("/gaim/gtk/sound/method", "arts");
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1152 else if(sound_options & OPT_SOUND_CMD)
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1153 gaim_prefs_set_string("/gaim/gtk/sound/method", "custom");
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1154 else if(sound_options & OPT_SOUND_BEEP)
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1155 gaim_prefs_set_string("/gaim/gtk/sound/method", "beep");
3de0e242f9a2 [gaim-migrate @ 6112]
Nathan Walp <nwalp@pidgin.im>
parents: 5684
diff changeset
1156 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1157 } else if (!strcmp(p->option, "away_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1158 away_options = atoi(p->value[0]);
5672
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1159 gaim_prefs_set_bool("/core/conversations/away_back_on_send",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1160 away_options & OPT_AWAY_BACK_ON_IM);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1161 gaim_prefs_set_bool("/core/away/away_when_idle",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1162 away_options & OPT_AWAY_AUTO);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1163 gaim_prefs_set_bool("/core/away/auto_response/enabled",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1164 !(away_options & OPT_AWAY_NO_AUTO_RESP));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1165 gaim_prefs_set_bool("/gaim/gtk/away/queue_messages",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1166 away_options & OPT_AWAY_QUEUE);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1167 gaim_prefs_set_bool("/core/away/auto_response/idle_only",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1168 away_options & OPT_AWAY_IDLE_RESP);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1169 gaim_prefs_set_bool("/plugins/gtk/docklet/queue_messages",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1170 away_options & OPT_AWAY_QUEUE_UNREAD);
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1171 gaim_prefs_set_bool("/core/away/auto_response/in_active_conv",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1172 !(away_options & OPT_AWAY_DELAY_IN_USE));
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1173 gaim_prefs_set_int("/core/away/auto_response/sec_before_resend",
5c5678c7b900 [gaim-migrate @ 6089]
Nathan Walp <nwalp@pidgin.im>
parents: 5671
diff changeset
1174 atoi(p->value[1]));
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1175 } else if (!strcmp(p->option, "font_face")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1176 gaim_prefs_set_string("/gaim/gtk/conversations/font_face",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1177 p->value[0]);
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1420
diff changeset
1178 } else if (!strcmp(p->option, "font_size")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1179 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0]));
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1180 } else if (!strcmp(p->option, "foreground")) {
5671
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1181 char buf[14];
5650
80682ac367fa [gaim-migrate @ 6064]
Luke Schierer <lschiere@pidgin.im>
parents: 5633
diff changeset
1182
5671
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1183 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x",
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1184 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1185 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1186
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1187 } else if (!strcmp(p->option, "background")) {
5671
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1188 char buf[14];
5650
80682ac367fa [gaim-migrate @ 6064]
Luke Schierer <lschiere@pidgin.im>
parents: 5633
diff changeset
1189
5671
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1190 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x",
d43a00b81d2a [gaim-migrate @ 6088]
Nathan Walp <nwalp@pidgin.im>
parents: 5667
diff changeset
1191 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1192 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
1193
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1194 } else if (!strcmp(p->option, "report_idle")) {
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1195 switch(atoi(p->value[0])) {
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1196 case IDLE_SCREENSAVER:
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1197 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method",
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1198 "system");
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1199 break;
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1200 case IDLE_GAIM:
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1201 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method",
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1202 "gaim");
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1203 break;
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1204 default:
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1205 gaim_prefs_set_string("/gaim/gtk/idle/reporting_method",
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1206 "none");
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1207 break;
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1208 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1209 } else if (!strcmp(p->option, "web_browser")) {
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1210 switch(atoi(p->value[0])) {
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1211 case BROWSER_NETSCAPE:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1212 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1213 "netscape");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1214 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1215 case BROWSER_KONQ:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1216 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1217 "kfmclient");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1218 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1219 case BROWSER_MANUAL:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1220 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1221 "manual");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1222 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1223 case BROWSER_GNOME:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1224 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1225 "gnome");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1226 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1227 case BROWSER_OPERA:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1228 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1229 "opera");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1230 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1231 case BROWSER_GALEON:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1232 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1233 "galeon");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1234 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1235 case BROWSER_MOZILLA:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1236 default:
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1237 gaim_prefs_set_string("/gaim/gtk/browsers/browser",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1238 "mozilla");
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1239 break;
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1240 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1241 } else if (!strcmp(p->option, "web_command")) {
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1242 gaim_prefs_set_string("/gaim/gtk/browsers/command", p->value[0]);
4288
a723d060620a [gaim-migrate @ 4541]
Sean Egan <seanegan@gmail.com>
parents: 4227
diff changeset
1243 } else if (!strcmp(p->option, "smiley_theme")) {
5841
eeb72d03e189 [gaim-migrate @ 6272]
Nathan Walp <nwalp@pidgin.im>
parents: 5823
diff changeset
1244 gaim_prefs_set_string("/gaim/gtk/smileys/theme", p->value[0]);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
1245 } else if (!strcmp(p->option, "conv_size")) {
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1246 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1247 atoi(p->value[0]));
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1248 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1249 atoi(p->value[1]));
6098
dbeaa5530f78 [gaim-migrate @ 6557]
Christian Hammond <chipx86@chipx86.com>
parents: 6097
diff changeset
1250 gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_height",
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1251 atoi(p->value[2]));
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
1252 } else if (!strcmp(p->option, "buddy_chat_size")) {
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1253 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1254 atoi(p->value[0]));
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1255 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height",
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1256 atoi(p->value[1]));
6098
dbeaa5530f78 [gaim-migrate @ 6557]
Christian Hammond <chipx86@chipx86.com>
parents: 6097
diff changeset
1257 gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_height",
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1258 atoi(p->value[2]));
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1259 } else if (!strcmp(p->option, "blist_pos")) {
5633
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1260 gaim_prefs_set_int("/gaim/gtk/blist/x", atoi(p->value[0]));
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1261 gaim_prefs_set_int("/gaim/gtk/blist/y", atoi(p->value[1]));
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1262 gaim_prefs_set_int("/gaim/gtk/blist/width", atoi(p->value[2]));
97a079bc8caa [gaim-migrate @ 6040]
Nathan Walp <nwalp@pidgin.im>
parents: 5632
diff changeset
1263 gaim_prefs_set_int("/gaim/gtk/blist/height", atoi(p->value[3]));
5422
af62169c74fd [gaim-migrate @ 5801]
Sean Egan <seanegan@gmail.com>
parents: 5337
diff changeset
1264 } else if (!strcmp(p->option, "sort_method")) {
6144
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1265 if(!strcmp(p->value[0], _("Alphabetical")))
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1266 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "alphabetical");
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1267 else if(!strcmp(p->value[0], _("By status")))
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1268 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "status");
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1269 else if(!strcmp(p->value[0], _("By log size")))
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1270 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "log_size");
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1271 else
7ec9166fd2c8 [gaim-migrate @ 6618]
Nathan Walp <nwalp@pidgin.im>
parents: 6101
diff changeset
1272 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", "none");
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 44
diff changeset
1273 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1275 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1277 if (read_general) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1278 if (!read_logging) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1279 logging_options = 0;
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
1280 gaim_prefs_set_bool("/gaim/gtk/logging/log_ims",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1281 general_options & OPT_GEN_LOG_ALL);
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
1282 gaim_prefs_set_bool("/gaim/gtk/logging/log_chats",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1283 general_options & OPT_GEN_LOG_ALL);
5804
1ba7dbd50d85 [gaim-migrate @ 6234]
Nathan Walp <nwalp@pidgin.im>
parents: 5748
diff changeset
1284 gaim_prefs_set_bool("/gaim/gtk/logging/strip_html",
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1285 general_options & OPT_GEN_STRIP_HTML);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1286 }
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
1287 }
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
1288
3391
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
1289 if (misc_options & OPT_MISC_BUDDY_TICKER) {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1290 if (gaim_plugins_enabled()) {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1291 gchar* buf;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1292
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1293 buf = g_strconcat(LIBDIR, G_DIR_SEPARATOR_S,
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1294 #ifndef _WIN32
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1295 "ticker.so",
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1296 #else
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1297 "ticker.dll",
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1298 #endif
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1299 NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1300
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1301 gaim_plugin_load(gaim_plugin_probe(buf));
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1302 g_free(buf);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1303 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1304
3391
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
1305 misc_options &= ~OPT_MISC_BUDDY_TICKER;
5823
41c8d5e82d12 [gaim-migrate @ 6253]
Nathan Walp <nwalp@pidgin.im>
parents: 5804
diff changeset
1306 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1307 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1309 static void gaimrc_read_sounds(FILE *f)
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1310 {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1311 int i;
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1312 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1313 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1314 struct parse *p;
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1315 char *pref_name;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1316
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1317 buf[0] = 0;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1318
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1319 for(i=0; i<GAIM_NUM_SOUNDS; i++) {
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1320 pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s",
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1321 gaim_gtk_sound_get_event_option(i));
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1322 gaim_prefs_set_string(pref_name, "");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1323 g_free(pref_name);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1324 }
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1325
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1326 while (buf[0] != '}') {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1327 if (buf[0] == '#')
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1328 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1329
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1330 if (!fgets(buf, sizeof(buf), f))
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1331 return;
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1332
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1333 p = parse_line(buf, &parse_buffer);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1334 #ifndef _WIN32
1214
0baf39dc5437 [gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1209
diff changeset
1335 if (!strcmp(p->option, "sound_cmd")) {
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1336 gaim_prefs_set_string("/gaim/gtk/sound/command", p->value[0]);
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1337 } else
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1338 #endif
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1339 if (!strncmp(p->option, "sound", strlen("sound"))) {
2036
ab15b91b93d8 [gaim-migrate @ 2046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1976
diff changeset
1340 i = p->option[strlen("sound")] - 'A';
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1341
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1342 pref_name = g_strdup_printf("/gaim/gtk/sound/file/%s",
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1343 gaim_gtk_sound_get_event_option(i));
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5681
diff changeset
1344 gaim_prefs_set_string(pref_name, p->value[0]);
6040
80e3641ee9eb [gaim-migrate @ 6490]
Mark Doliner <mark@kingant.net>
parents: 6033
diff changeset
1345 g_free(pref_name);
1214
0baf39dc5437 [gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1209
diff changeset
1346 }
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1347 }
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1348 }
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1349
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1350 static gboolean gaimrc_parse_proxy_uri(const char *proxy)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1351 {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1352 GaimProxyInfo *info;
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1353
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1354 char *c, *d;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1355 char buffer[2048];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1356
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1357 char host[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1358 char user[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1359 char pass[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1360 int port = 0;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1361 int len = 0;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1362
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1363 host[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1364 user[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1365 pass[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1366
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1367 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1368 "gaimrc_parse_proxy_uri(%s)\n", proxy);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1369
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1370 if ((c = strchr(proxy, ':')) == NULL)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1371 {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1372 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1373 "No URI detected.\n");
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1374 /* No URI detected. */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1375 return FALSE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1376 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1377
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1378 len = c - proxy;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1379
5537
3becf79500d2 [gaim-migrate @ 5937]
Mark Doliner <mark@kingant.net>
parents: 5534
diff changeset
1380 if (strncmp(proxy, "http://", len + 3))
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1381 return FALSE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1382
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1383 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Found HTTP proxy.\n");
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1384 /* Get past "://" */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1385 c += 3;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1386
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1387 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Looking at %s\n", c);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1388
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1389 for (;;)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1390 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1391 *buffer = '\0';
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1392 d = buffer;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1393
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1394 while (*c != '\0' && *c != '@' && *c != ':' && *c != '/')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1395 *d++ = *c++;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1396
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1397 *d = '\0';
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1398
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1399 if (*c == ':')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1400 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1401 /*
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1402 * If there is a '@' in there somewhere, we are in the auth part.
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1403 * If not, host.
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1404 */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1405 if (strchr(c, '@') != NULL)
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1406 strcpy(user, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1407 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1408 strcpy(host, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1409 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1410 else if (*c == '@')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1411 {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1412 if (user[0] == '\0')
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1413 strcpy(user, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1414 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1415 strcpy(pass, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1416 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1417 else if (*c == '/' || *c == '\0')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1418 {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1419 if (host[0] == '\0')
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1420 strcpy(host, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1421 else
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1422 port = atoi(buffer);
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1423
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1424 /* Done. */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1425 break;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1426 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1427
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1428 c++;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1429 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1430
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1431 /* NOTE: HTTP_PROXY takes precendence. */
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1432 info = gaim_global_proxy_get_info();
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1433
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1434 if (*host) gaim_proxy_info_set_host(info, host);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1435 if (*user) gaim_proxy_info_set_username(info, user);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1436 if (*pass) gaim_proxy_info_set_password(info, pass);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1437
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1438 gaim_proxy_info_set_port(info, port);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1439
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1440 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1441 "Host: '%s', User: '%s', Password: '%s', Port: %d\n",
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1442 gaim_proxy_info_get_host(info),
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1443 gaim_proxy_info_get_username(info),
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1444 gaim_proxy_info_get_password(info),
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1445 gaim_proxy_info_get_port(info));
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1446
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1447 return TRUE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1448 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1449
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1450 static void gaimrc_read_proxy(FILE *f)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1451 {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1452 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1453 struct parse parse_buffer;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1454 struct parse *p;
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1455 GaimProxyInfo *info;
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1456
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1457 info = gaim_global_proxy_get_info();
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1458
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1459 buf[0] = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1460 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "gaimrc_read_proxy\n");
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1461
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1462 while (buf[0] != '}') {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1463 if (buf[0] == '#')
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1464 continue;
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1465
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1466 if (!fgets(buf, sizeof(buf), f))
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1467 return;
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1468
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1469 p = parse_line(buf, &parse_buffer);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1470
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1471 if (!strcmp(p->option, "host")) {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1472 gaim_proxy_info_set_host(info, p->value[0]);
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1473 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1474 "Set proxyhost %s\n", p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1475 } else if (!strcmp(p->option, "port")) {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1476 gaim_proxy_info_set_port(info, atoi(p->value[0]));
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1477 } else if (!strcmp(p->option, "type")) {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1478 gaim_proxy_info_set_type(info, atoi(p->value[0]));
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1479 } else if (!strcmp(p->option, "user")) {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1480 gaim_proxy_info_set_username(info, p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1481 } else if (!strcmp(p->option, "pass")) {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1482 gaim_proxy_info_set_password(info, p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1483 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1484 }
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1485
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1486 if (gaim_proxy_info_get_host(info) != NULL)
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1487 gaim_global_proxy_set_from_prefs(TRUE);
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1488 else {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1489 const char *host;
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1490 gboolean getVars = TRUE;
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1491
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1492 if ((host = g_getenv("HTTP_PROXY")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1493 (host = g_getenv("http_proxy")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1494 (host = g_getenv("HTTPPROXY")) != NULL) {
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1495
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1496 gaim_proxy_info_set_host(info, host);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1497 }
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1498
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1499 if (gaim_proxy_info_get_host(info) != NULL)
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1500 getVars = !gaimrc_parse_proxy_uri(gaim_proxy_info_get_host(info));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1501
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1502 if (getVars)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1503 {
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1504 const char *port_str, *user, *pass;
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1505
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1506 if ((port_str = g_getenv("HTTP_PROXY_PORT")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1507 (port_str = g_getenv("http_proxy_port")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1508 (port_str = g_getenv("HTTPPROXYPORT")) != NULL) {
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1509
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1510 gaim_proxy_info_set_port(info, atoi(port_str));
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1511 }
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1512
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1513 if ((user = g_getenv("HTTP_PROXY_USER")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1514 (user = g_getenv("http_proxy_user")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1515 (user = g_getenv("HTTPPROXYUSER")) != NULL) {
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1516
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1517 gaim_proxy_info_set_username(info, user);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1518 }
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1519
5681
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1520 if ((pass = g_getenv("HTTP_PROXY_PASS")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1521 (pass = g_getenv("http_proxy_pass")) != NULL ||
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1522 (pass = g_getenv("HTTPPROXYPASS")) != NULL) {
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1523
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1524 gaim_proxy_info_set_password(info, pass);
46d7ad0dfa26 [gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents: 5672
diff changeset
1525 }
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1526 }
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1527 }
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1528 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1529
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1530 static void set_defaults()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1531 {
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1532 #if 0
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1533 int i;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1534 struct away_message *a;
917
f3c23b3c1ed7 [gaim-migrate @ 927]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1535
4227
a614423c648f [gaim-migrate @ 4471]
Mark Doliner <mark@kingant.net>
parents: 4201
diff changeset
1536 misc_options =
a614423c648f [gaim-migrate @ 4471]
Mark Doliner <mark@kingant.net>
parents: 4201
diff changeset
1537 OPT_MISC_USE_SERVER_ALIAS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1538
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1539 logging_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1540
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1541 blist_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1542 OPT_BLIST_SHOW_GRPNUM |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1543 OPT_BLIST_SHOW_PIXMAPS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1544 OPT_BLIST_SHOW_IDLETIME |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1545 OPT_BLIST_GREY_IDLERS |
4962
b6fd57ba76e8 [gaim-migrate @ 5296]
Sean Egan <seanegan@gmail.com>
parents: 4944
diff changeset
1546 OPT_BLIST_SHOW_BUTTON_XPM |
b6fd57ba76e8 [gaim-migrate @ 5296]
Sean Egan <seanegan@gmail.com>
parents: 4944
diff changeset
1547 OPT_BLIST_SHOW_ICONS;
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 774
diff changeset
1548
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1549 convo_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1550 OPT_CONVO_ENTER_SENDS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1551 OPT_CONVO_SEND_LINKS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1552 OPT_CONVO_CTL_CHARS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1553 OPT_CONVO_CTL_SMILEYS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1554 OPT_CONVO_SHOW_TIME |
3919
82d3edd659cb [gaim-migrate @ 4082]
Sean Egan <seanegan@gmail.com>
parents: 3903
diff changeset
1555 OPT_CONVO_SHOW_SMILEY |
82d3edd659cb [gaim-migrate @ 4082]
Sean Egan <seanegan@gmail.com>
parents: 3903
diff changeset
1556 OPT_CONVO_CHECK_SPELLING;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1557
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
1558 conv_placement_option = 0;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
1559
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1560 im_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1561 OPT_IM_LOGON |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1562 OPT_IM_BUTTON_XPM |
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1563 OPT_IM_ONE_WINDOW ;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1564
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1565 chat_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1566 OPT_CHAT_LOGON |
2388
5a7234d5e052 [gaim-migrate @ 2401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2383
diff changeset
1567 OPT_CHAT_BUTTON_XPM |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1568 OPT_CHAT_TAB_COMPLETE |
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1569 OPT_CHAT_ONE_WINDOW;
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 774
diff changeset
1570
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1571 font_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1572
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1573 away_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1574 OPT_AWAY_BACK_ON_IM;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1575
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1576 for (i = 0; i < GAIM_NUM_SOUNDS; i++)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1577 gaim_sound_set_event_file(i, NULL);
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1578
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1579 font_options = 0;
2580
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1580 /* Enable all of the sound players that might be available. The first
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1581 available one will be used. */
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1582 sound_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1583 OPT_SOUND_LOGIN |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1584 OPT_SOUND_LOGOUT |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1585 OPT_SOUND_RECV |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1586 OPT_SOUND_SEND |
2580
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1587 OPT_SOUND_SILENT_SIGNON |
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
1588 OPT_SOUND_NORMAL |
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
1589 OPT_SOUND_NAS;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1590
2990
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1591 #ifdef USE_SCREENSAVER
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1592 report_idle = IDLE_SCREENSAVER;
2990
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1593 #else
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1594 report_idle = IDLE_GAIM;
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1595 #endif
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1596 web_browser = BROWSER_NETSCAPE;
3434
0c281a80767d [gaim-migrate @ 3463]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1597 g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s");
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1598
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1599 auto_away = 10;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1600 a = g_new0(struct away_message, 1);
4589
eddb870a3c4d [gaim-migrate @ 4873]
Luke Schierer <lschiere@pidgin.im>
parents: 4581
diff changeset
1601 g_snprintf(a->name, sizeof(a->name), _("boring default"));
6321
3613007cbb6e [gaim-migrate @ 6820]
Luke Schierer <lschiere@pidgin.im>
parents: 6223
diff changeset
1602 g_snprintf(a->message, sizeof(a->message), "%s", _(BORING_DEFAULT_AWAY_MSG));
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1603 away_messages = g_slist_append(away_messages, a);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1604 default_away = a;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1605
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1606 blist_pos.width = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1607 blist_pos.height = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1608 blist_pos.x = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1609 blist_pos.y = 0;
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
1610
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1611 conv_size.width = 320;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1612 conv_size.height = 175;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1613 conv_size.entry_height = 50;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1614
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1615 buddy_chat_size.width = 320;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1616 buddy_chat_size.height = 160;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1617 buddy_chat_size.entry_height = 50;
5631
960fe32ea9b7 [gaim-migrate @ 6038]
Nathan Walp <nwalp@pidgin.im>
parents: 5618
diff changeset
1618 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1620
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1621 void load_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623 FILE *f;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624 char buf[1024];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1625 int ver = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1626
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1627 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Loading preferences.\n");
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1628
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1629 if (is_saving_prefs) {
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1630 request_load_prefs = 1;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1631 gaim_debug(GAIM_DEBUG_INFO, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1632 "Currently saving. Will request load.\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1633 return;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1634 }
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
1635
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1636 if (opt_rcfile_arg)
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1637 g_snprintf(buf, sizeof(buf), "%s", opt_rcfile_arg);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1638 else if (gaim_home_dir())
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1639 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S ".gaimrc", gaim_home_dir());
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1640 else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1641 set_defaults();
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1642 return;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1643 }
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1644
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1645 if ((f = fopen(buf, "r"))) {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1646 is_loading_prefs = 1;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1647 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "start load_prefs\n");
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1648 fgets(buf, sizeof(buf), f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1649 sscanf(buf, "# .gaimrc v%d", &ver);
2389
021ba044ab0b [gaim-migrate @ 2402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2388
diff changeset
1650 if ((ver <= 3) || (buf[0] != '#'))
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1651 set_defaults();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1652
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1653 while (!feof(f)) {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1654 int tag = gaimrc_parse_tag(f);
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1655 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1656 "starting read tag %d\n", tag);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1657 switch (tag) {
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1658 case -1:
5514
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
1659 /* Do nothing--either EOF or empty line */
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1660 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1661 case 0:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1662 gaimrc_read_users(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1663 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1664 case 1:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1665 gaimrc_read_options(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1666 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1667 case 2:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1668 gaimrc_read_away(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1669 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1670 case 3:
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1671 if (gaim_plugins_enabled())
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1672 gaimrc_read_plugins(f);
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1673 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1674 case 4:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1675 gaimrc_read_pounce(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1676 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1677 case 6:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1678 gaimrc_read_sounds(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1679 break;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1680 case 7:
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1681 gaimrc_read_proxy(f);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1682 break;
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1683 default:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1684 /* NOOP */
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1685 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1686 }
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1687 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1688 "ending read tag %d\n", tag);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1689 }
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1690 fclose(f);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1691 is_loading_prefs = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1692 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "end load_prefs\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1693 if (request_save_prefs) {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1694 gaim_debug(GAIM_DEBUG_INFO, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1695 "Saving preferences on request\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1696 request_save_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1697 }
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1698 } else if (opt_rcfile_arg) {
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1699 g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg);
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5422
diff changeset
1700 gaim_notify_error(NULL, NULL, buf, NULL);
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1701 set_defaults();
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1702 } else {
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1703 set_defaults();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1704 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1705
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1706 prefs_initial_load = 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1707 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1708
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1709 void save_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1710 {
5560
b7319c094153 [gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents: 5554
diff changeset
1711 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "save_prefs() called. Rejected!\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1712 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1713
1209
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1714
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1715 /* This function is called by g_slist_insert_sorted to compare the item
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1716 * being compared to the rest of the items on the list.
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1717 */
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1718
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1719 gint sort_awaymsg_list(gconstpointer a, gconstpointer b)
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1720 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1721 struct away_message *msg_a;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1722 struct away_message *msg_b;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1723
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1724 msg_a = (struct away_message *)a;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1725 msg_b = (struct away_message *)b;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1726
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1727 return (strcmp(msg_a->name, msg_b->name));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1728
1209
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1729 }
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1730
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1731 void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1732 load_pounces()
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1733 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1734 GList *l;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1735 struct pounce_placeholder *ph;
5857
2fa4aa9c1885 [gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents: 5841
diff changeset
1736 GaimPounce *pounce;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
1737 GaimAccount *account;
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1738
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1739 for (l = buddy_pounces; l != NULL; l = l->next) {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1740 GaimPounceEvent events = GAIM_POUNCE_NONE;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1741 GaimGtkPounceAction actions = GAIM_GTKPOUNCE_NONE;
5035
628681ec8a5e [gaim-migrate @ 5378]
Luke Schierer <lschiere@pidgin.im>
parents: 5032
diff changeset
1742 ph = (struct pounce_placeholder *)l->data;
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1743
5874
964e4f94fc56 [gaim-migrate @ 6306]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
1744 account = gaim_accounts_find(ph->pouncer, ph->protocol);
5972
c36b3c654761 [gaim-migrate @ 6419]
Mark Doliner <mark@kingant.net>
parents: 5943
diff changeset
1745 if (account == NULL)
c36b3c654761 [gaim-migrate @ 6419]
Mark Doliner <mark@kingant.net>
parents: 5943
diff changeset
1746 continue;
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1747
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1748 old_pounce_opts_to_new(ph->options, &events, &actions);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1749
5875
448f2f4ca3ec [gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents: 5874
diff changeset
1750 pounce = gaim_pounce_new(GAIM_GTK_UI, account, ph->name, events);
5864
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1751
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1752 gaim_pounce_action_set_enabled(pounce, "open-window",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1753 (actions & GAIM_GTKPOUNCE_OPEN_WIN));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1754 gaim_pounce_action_set_enabled(pounce, "popup-notify",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1755 (actions & GAIM_GTKPOUNCE_POPUP));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1756 gaim_pounce_action_set_enabled(pounce, "send-message",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1757 (actions & GAIM_GTKPOUNCE_SEND_MSG));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1758 gaim_pounce_action_set_enabled(pounce, "execute-command",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1759 (actions & GAIM_GTKPOUNCE_EXEC_CMD));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1760 gaim_pounce_action_set_enabled(pounce, "play-sound",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1761 (actions & GAIM_GTKPOUNCE_PLAY_SOUND));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1762
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1763 gaim_pounce_action_set_attribute(pounce, "send-message", "message",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1764 (*ph->message == '\0' ? NULL : ph->message));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1765 gaim_pounce_action_set_attribute(pounce, "execute-command", "command",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1766 (*ph->sound == '\0' ? NULL : ph->message));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1767 gaim_pounce_action_set_attribute(pounce, "play-sound", "filename",
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1768 (*ph->sound == '\0' ? NULL : ph->message));
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1769
417b1001d2b1 [gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents: 5858
diff changeset
1770 gaim_pounce_set_save(pounce, (ph->options & 0x100));
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1771
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1772 g_free(ph);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1773 }
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1774
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1775 g_list_free(buddy_pounces);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1776 buddy_pounces = NULL;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1777
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1778 /*
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1779 * < ChipX86|Coding> why do we save prefs just after reading them?
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1780 * < faceprint> ChipX86|Coding: because we're cool like that
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1781 * <SeanEgan|Coding> damn straight
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1782 */
5593
b07aa997ddd8 [gaim-migrate @ 5997]
Christian Hammond <chipx86@chipx86.com>
parents: 5580
diff changeset
1783 /* save_prefs(); -- I like the above comment :( */
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1784 }