annotate src/gaimrc.c @ 5618:83991299705c

[gaim-migrate @ 6025] i really need to go grocery shopping committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 31 May 2003 20:55:31 +0000
parents 9cd94a5bec8e
children 960fe32ea9b7
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 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
22 #ifdef HAVE_CONFIG_H
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2036
diff changeset
23 #include <config.h>
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
26
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
27 #ifndef _WIN32
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <sys/time.h>
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
29 #include <unistd.h>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
30 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34
4201
511c2b63caa4 [gaim-migrate @ 4432]
Christian Hammond <chipx86@chipx86.com>
parents: 4189
diff changeset
35 #include <ctype.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include "gaim.h"
1264
6210d06da99b [gaim-migrate @ 1274]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1254
diff changeset
39 #include "prpl.h"
5442
702071b23c06 [gaim-migrate @ 5824]
Nathan Walp <nwalp@pidgin.im>
parents: 5440
diff changeset
40 #include "prefs.h"
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
41 #include "proxy.h"
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
42 #include "sound.h"
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
43 #include "pounce.h"
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
44 #include "gtkpounce.h"
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5422
diff changeset
45 #include "notify.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
47 #ifdef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
48 #include "win32dep.h"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
49 #endif
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
50
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
51 /* 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
52 #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
53 #define MAX_VALUES 10
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
55 #define OPT_FONT_BOLD 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
56 #define OPT_FONT_ITALIC 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
57 #define OPT_FONT_UNDERLINE 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
58 #define OPT_FONT_STRIKE 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
59 #define OPT_FONT_FACE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
60 #define OPT_FONT_FGCOL 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
61 #define OPT_FONT_BGCOL 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
62 #define OPT_FONT_SIZE 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
63
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
64 #define OPT_MISC_DEBUG 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
65 #define OPT_MISC_BROWSER_POPUP 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
66 #define OPT_MISC_BUDDY_TICKER 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
67 #define OPT_MISC_STEALTH_TYPING 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
68 #define OPT_MISC_USE_SERVER_ALIAS 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
69
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
70 #define OPT_LOG_CONVOS 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
71 #define OPT_LOG_STRIP_HTML 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
72 #define OPT_LOG_INDIVIDUAL 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
73 #define OPT_LOG_CHATS 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
74
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
75 #define OPT_BLIST_SHOW_GRPNUM 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
76 #define OPT_BLIST_SHOW_PIXMAPS 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
77 #define OPT_BLIST_SHOW_IDLETIME 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
78 #define OPT_BLIST_SHOW_BUTTON_XPM 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
79 #define OPT_BLIST_NO_BUTTON_TEXT 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
80 #define OPT_BLIST_NO_MT_GRP 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
81 #define OPT_BLIST_SHOW_WARN 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
82 #define OPT_BLIST_GREY_IDLERS 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
83 #define OPT_BLIST_POPUP 0x00001000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
84 #define OPT_BLIST_SHOW_ICONS 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
85 #define OPT_BLIST_SHOW_OFFLINE 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
86
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
87 #define OPT_CONVO_ENTER_SENDS 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
88 #define OPT_CONVO_SEND_LINKS 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
89 #define OPT_CONVO_CHECK_SPELLING 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
90 #define OPT_CONVO_CTL_CHARS 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
91 #define OPT_CONVO_CTL_SMILEYS 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
92 #define OPT_CONVO_ESC_CAN_CLOSE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
93 #define OPT_CONVO_CTL_ENTER 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
94 #define OPT_CONVO_F2_TOGGLES 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
95 #define OPT_CONVO_SHOW_TIME 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
96 #define OPT_CONVO_IGNORE_COLOUR 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
97 #define OPT_CONVO_SHOW_SMILEY 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
98 #define OPT_CONVO_IGNORE_FONTS 0x00000800
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
99 #define OPT_CONVO_IGNORE_SIZES 0x00001000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
100 #define OPT_CONVO_COMBINE 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
101 #define OPT_CONVO_CTL_W_CLOSES 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
102 #define OPT_CONVO_NO_X_ON_TAB 0x00008000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
103
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
104 #define OPT_IM_POPUP 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
105 #define OPT_IM_LOGON 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
106 #define OPT_IM_BUTTON_TEXT 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
107 #define OPT_IM_BUTTON_XPM 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
108 #define OPT_IM_ONE_WINDOW 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
109 #define OPT_IM_SIDE_TAB 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
110 #define OPT_IM_BR_TAB 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
111 #define OPT_IM_HIDE_ICONS 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
112 #define OPT_IM_NO_ANIMATION 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
113 #define OPT_IM_ALIAS_TAB 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
114 #define OPT_IM_POPDOWN 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
115
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
116 #define OPT_CHAT_ONE_WINDOW 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
117 #define OPT_CHAT_BUTTON_TEXT 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
118 #define OPT_CHAT_BUTTON_XPM 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
119 #define OPT_CHAT_LOGON 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
120 #define OPT_CHAT_POPUP 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
121 #define OPT_CHAT_SIDE_TAB 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
122 #define OPT_CHAT_BR_TAB 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
123 #define OPT_CHAT_TAB_COMPLETE 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
124 #define OPT_CHAT_OLD_STYLE_TAB 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
125 #define OPT_CHAT_COLORIZE 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
126
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
127 #define OPT_SOUND_LOGIN 0x00000001
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
128 #define OPT_SOUND_LOGOUT 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
129 #define OPT_SOUND_RECV 0x00000004
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
130 #define OPT_SOUND_SEND 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
131 #define OPT_SOUND_FIRST_RCV 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
132 #define OPT_SOUND_WHEN_AWAY 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
133 #define OPT_SOUND_SILENT_SIGNON 0x00000040
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
134 #define OPT_SOUND_THROUGH_GNOME 0x00000080
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
135 #define OPT_SOUND_CHAT_JOIN 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
136 #define OPT_SOUND_CHAT_SAY 0x00000200
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
137 #define OPT_SOUND_BEEP 0x00000400
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
138 #define OPT_SOUND_CHAT_PART 0x00000800
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
139 #define OPT_SOUND_CHAT_YOU_SAY 0x00001000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
140 #define OPT_SOUND_NORMAL 0x00002000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
141 #define OPT_SOUND_NAS 0x00004000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
142 #define OPT_SOUND_ARTS 0x00008000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
143 #define OPT_SOUND_ESD 0x00010000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
144 #define OPT_SOUND_CMD 0x00020000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
145 #define OPT_SOUND_CHAT_NICK 0x00040000
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
146
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
147 #define OPT_AWAY_BACK_ON_IM 0x00000002
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
148 #define OPT_AWAY_AUTO 0x00000008
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
149 #define OPT_AWAY_NO_AUTO_RESP 0x00000010
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
150 #define OPT_AWAY_QUEUE 0x00000020
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
151 #define OPT_AWAY_IDLE_RESP 0x00000040
5554
7b36d02031a2 [gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents: 5545
diff changeset
152 #define OPT_AWAY_QUEUE_UNREAD 0x00000080
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
153 #define OPT_AWAY_DELAY_IN_USE 0x00000100
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
154
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
155 #define OPT_ACCT_AUTO 0x00000001
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
156 /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
157 #define OPT_ACCT_REM_PASS 0x00000004
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
158 #define OPT_ACCT_MAIL_CHECK 0x00000008
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
159
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
160 static guint misc_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
161 static guint logging_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
162 static guint blist_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
163 static guint convo_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
164 static guint im_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
165 static guint conv_placement_option;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
166 static guint chat_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
167 static guint font_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
168 static guint sound_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
169 static guint away_options;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
170 static guint away_resend;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
171 static guint is_loading_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
172 static guint request_save_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
173 static guint is_saving_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
174 static guint request_load_prefs = 0;
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
175 static guint prefs_initial_load = 0;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
176 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
177 * was loaded from the file
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
178 * or otherwise explicitly requested */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
180 int report_idle;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
181 int web_browser;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 struct save_pos blist_pos;
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
183 struct window_size conv_size, buddy_chat_size;
4189
02f4eacf4c58 [gaim-migrate @ 4420]
Luke Schierer <lschiere@pidgin.im>
parents: 4188
diff changeset
184 char web_command[2048] = "";
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
186 static GdkColor fgcolor;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
187 static GdkColor bgcolor;
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
188
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 struct parse {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
190 char option[256];
2286
f00bf9537bb7 [gaim-migrate @ 2296]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
191 char value[MAX_VALUES][4096];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193
5032
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 * This is absolutely necessary, unfortunately. It is used to grab
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
196 * 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
197 * 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
198 * list isn't processed yet.
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
199 *
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
200 * -- ChipX86
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
201 */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
202 struct pounce_placeholder
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
203 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
204 char name[80];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
205 char message[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
206 char command[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
207 char sound[2048];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
208 char pouncer[80];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
209
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
210 int protocol;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
211 int options;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
212 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
213
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
214 static GList *buddy_pounces = NULL;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
215
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
216 static struct parse *parse_line(char *line, struct parse *p)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
218 char *c = line;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
219 int inopt = 1, inval = 0, curval = -1;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
220 int optlen = 0, vallen = 0, last_non_space = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
221 int x;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
223 for (x = 0; x < MAX_VALUES; x++) {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
224 p->value[x][0] = 0;
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
225 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
226
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
227 while (*c) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
228 if (*c == '\t') {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
229 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
230 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
231 }
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
232
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
233 if (inopt) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
234 if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
235 inopt = 0;
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
236 p->option[optlen] = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
240
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
241 p->option[optlen] = *c;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
242 optlen++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
243 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
244 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
245 } else if (inval) {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
246 if (*c == '\\') {
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
247 /* if we have a \ take the char after it literally.. */
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 p->value[curval][vallen] = *c;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
250
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
251 vallen++;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
252 last_non_space = vallen;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
253 c++;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
254 continue;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
255 } else if (*c == '}') {
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
256 /* } that isn't escaped should end this chunk of data, and
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
257 * should have a space before it.. */
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
258 p->value[curval][last_non_space] = 0;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
259 inval = 0;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
260 c++;
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
261 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
262 } else {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
263 p->value[curval][vallen] = *c;
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
264
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
265 vallen++;
5109
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
266 if (isspace(*c))
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
267 last_non_space = vallen - 1;
145587c11207 [gaim-migrate @ 5472]
Mark Doliner <mark@kingant.net>
parents: 5108
diff changeset
268 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
269 last_non_space = vallen;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
270 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
271 continue;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
273 } else if (*c == '{') {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
274 /* 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
275 * not brave enough to take it out... */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
276 if (*(c - 1) == '\\') {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
277 p->value[curval][vallen] = *c;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
278 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
279 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
280 } else {
4049
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
281 /* { that isn't escaped should signify the start of a
198a5edcb1c5 [gaim-migrate @ 4258]
Sean Egan <seanegan@gmail.com>
parents: 4042
diff changeset
282 * piece of data and should have a space after it.. */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
283 curval++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
284 vallen = 0;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
285 last_non_space = vallen;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
286 inval = 1;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
287 c++;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
288 while (*c && isspace(*c))
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
289 c++;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
290 continue;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
291 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
292 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
293 c++;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
294 }
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
295
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
296 return p;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 static int gaimrc_parse_tag(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 char buf[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 char tag[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 buf[0] = '#';
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 while (buf[0] == '#' && !feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 fgets(buf, sizeof(buf), f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 if (feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311
5514
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
312 if (sscanf(buf, "%s {", tag) != 1)
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
313 return -1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 if (!strcmp(tag, "users")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 } else if (!strcmp(tag, "options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 return 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 } else if (!strcmp(tag, "away")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320 return 2;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
321 } else if (!strcmp(tag, "plugins")) {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
322 return 3;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
323 } else if (!strcmp(tag, "pounce")) {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
324 return 4;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
325 } else if (!strcmp(tag, "sound_files")) {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
326 return 6;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
327 } else if (!strcmp(tag, "proxy")) {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
328 return 7;
4026
a997156437b6 [gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3924
diff changeset
329 } else if (!strcmp(tag, "wgaim")) {
a997156437b6 [gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3924
diff changeset
330 return 8;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 static void gaimrc_read_away(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
337 struct parse parse_buffer;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 char buf[4096];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 struct away_message *a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
343
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
344 while (buf[0] != '}') {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346 return;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
347
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 if (buf[0] == '}')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
351 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
352 if (!strcmp(p->option, "message")) {
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
353 a = g_new0(struct away_message, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
355 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
356 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
357 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
358 }
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
359 /* auto { time } { default message } */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
360 else if (!strcmp(p->option, "auto")) {
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
361 auto_away = atoi(p->value[0]);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2369
diff changeset
362 default_away = g_slist_nth_data(away_messages, atoi(p->value[1]));
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
363 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
364 }
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
365 if (!away_messages) {
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
366 a = g_new0(struct away_message, 1);
4589
eddb870a3c4d [gaim-migrate @ 4873]
Luke Schierer <lschiere@pidgin.im>
parents: 4581
diff changeset
367 g_snprintf(a->name, sizeof(a->name), _("boring default"));
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
368 g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
369 away_messages = g_slist_append(away_messages, a);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
370 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
371 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
373 /*
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
374 * 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
375 * 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
376 * 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
377 * When we have a better prefs system, this can go away.
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
378 *
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
379 * -- ChipX86
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
380 */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
381 static int pounce_evt_trans_table[] =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
382 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
383 0x010, GAIM_POUNCE_SIGNON,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
384 0x020, GAIM_POUNCE_AWAY_RETURN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
385 0x040, GAIM_POUNCE_IDLE_RETURN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
386 0x080, GAIM_POUNCE_TYPING,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
387 /* 0x100, save, is handled separately. */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
388 0x400, GAIM_POUNCE_SIGNOFF,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
389 0x800, GAIM_POUNCE_AWAY,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
390 0x1000, GAIM_POUNCE_IDLE,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
391 0x2000, GAIM_POUNCE_TYPING_STOPPED
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
392 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
393
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
394 static int pounce_act_trans_table[] =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
395 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
396 0x001, GAIM_GTKPOUNCE_OPEN_WIN,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
397 0x002, GAIM_GTKPOUNCE_SEND_MSG,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
398 0x004, GAIM_GTKPOUNCE_EXEC_CMD,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
399 0x008, GAIM_GTKPOUNCE_PLAY_SOUND,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
400 /* 0x100, save, is handled separately. */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
401 0x200, GAIM_GTKPOUNCE_POPUP
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
402 };
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
403
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
404 static int pounce_evt_trans_table_size =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
405 (sizeof(pounce_evt_trans_table) / sizeof(*pounce_evt_trans_table));
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 static int pounce_act_trans_table_size =
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
408 (sizeof(pounce_act_trans_table) / sizeof(*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 static void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
411 old_pounce_opts_to_new(int opts, GaimPounceEvent *events,
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
412 GaimGtkPounceAction *actions)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
413 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
414 int i;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
415
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
416 *events = 0;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
417 *actions = 0;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
418
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
419 /* First, convert events */
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
420 for (i = 0; i < pounce_evt_trans_table_size; i += 2)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
421 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
422 int evt = pounce_evt_trans_table[i];
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 if ((opts & evt) == evt)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
425 *events |= pounce_evt_trans_table[i + 1];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
426 }
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 for (i = 0; i < pounce_act_trans_table_size; i += 2)
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 int act = pounce_act_trans_table[i];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
431
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
432 if ((opts & act) == act)
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
433 *actions |= pounce_act_trans_table[i + 1];
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
434
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 }
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 static void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
439 gaimrc_read_pounce(FILE *f)
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
440 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
441 struct parse parse_buffer;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
442 struct parse *p;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
443 char buf[4096];
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
444 struct pounce_placeholder *b;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
445
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
446 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
447
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
448 while (buf[0] != '}') {
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
449 if (!fgets(buf, sizeof(buf), f))
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
450 return;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
451
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
452 if (buf[0] == '}')
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
453 return;
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 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
456 if (!strcmp(p->option, "entry")) {
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
457 b = g_new0(struct pounce_placeholder, 1);
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
458
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
459 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
460 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
461 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
462
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
463 b->options = atoi(p->value[3]);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
464
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
465 g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[4]);
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
466 b->protocol = atoi(p->value[5]);
1137
5b5d03dfa48a [gaim-migrate @ 1147]
Rob Flynn <gaim@robflynn.com>
parents: 1109
diff changeset
467
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1560
diff changeset
468 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
469
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
470 buddy_pounces = g_list_append(buddy_pounces, b);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
471 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
472 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
473 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
474
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
475 static void gaimrc_read_plugins(FILE *f)
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
476 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
477 struct parse parse_buffer;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
478 struct parse *p;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
479 char buf[4096];
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
480
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
481 buf[0] = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
482
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
483 while (buf[0] != '}') {
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
484 if (!fgets(buf, sizeof(buf), f))
1236
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
485 break;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
486
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
487 if (buf[0] == '}')
1236
dcf9242241ee [gaim-migrate @ 1246]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
488 break;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
489
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
490 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
491 if (!strcmp(p->option, "plugin")) {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
492 gaim_plugin_load(gaim_plugin_probe(p->value[0]));
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
493 }
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 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
497 static GaimAccount *gaimrc_read_user(FILE *f)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 {
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
499 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
500 struct parse *p;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
501 GaimAccount *account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
502 int i;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
503 char buf[4096];
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
504 char user_info[2048];
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
505 int flags;
5618
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
506 char *tmp;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
508 if (!fgets(buf, sizeof(buf), f))
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
509 return NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
511 p = parse_line(buf, &parse_buffer);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
513 if (strcmp(p->option, "ident"))
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
514 return NULL;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
515
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
516 account = gaim_account_new(p->value[0], GAIM_PROTO_DEFAULT);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
518 gaim_account_set_password(account, p->value[1]);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
519 gaim_account_set_remember_password(account, TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
521 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
522 return account;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
524 if (strcmp(buf, "\t\tuser_info {\n")) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
525 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
526 }
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 (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
529 return account;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
531 *user_info = '\0';
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
532
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
533 while (strncmp(buf, "\t\t}", 3)) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
534 if (strlen(buf) > 3)
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
535 strcat(user_info, buf + 3);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
537 if (!fgets(buf, sizeof(buf), f)) {
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
538 gaim_account_set_user_info(account, user_info);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
539
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
540 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
541 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
542 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
5568
fb4f7bd7525c [gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents: 5563
diff changeset
544 if ((i = strlen(user_info)))
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
545 user_info[i - 1] = '\0';
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
546
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
547 if (*user_info != '.')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
548 gaim_account_set_user_info(account, user_info);
1292
cb84b5c6d9ab [gaim-migrate @ 1302]
Rob Flynn <gaim@robflynn.com>
parents: 1264
diff changeset
549
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
550 if (!fgets(buf, sizeof(buf), f)) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
551 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
552 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
553
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
554 if (!strcmp(buf, "\t}")) {
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
555 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
556 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
557
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
558 p = parse_line(buf, &parse_buffer);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
559
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
560 if (strcmp(p->option, "user_opts"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
561 return account;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
562
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
563 /* TODO: Handle OPT_ACCT_AUTO and OPT_ACCT_MAIL_CHECK */
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
564
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
565 flags = atoi(p->value[0]);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
566
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
567 if (!(flags & OPT_ACCT_REM_PASS))
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
568 gaim_account_set_remember_password(account, FALSE);
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
569
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
570 gaim_account_set_protocol(account, atoi(p->value[1]));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
571
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
572 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
573 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
574
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
575 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
576 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
577
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
578 p = parse_line(buf, &parse_buffer);
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
579
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
580 if (strcmp(p->option, "proto_opts"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
581 return account;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
582
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
583 /* I hate this part. We must convert the protocol options. */
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
584 switch (gaim_account_get_protocol(account)) {
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
585 case GAIM_PROTO_TOC:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
586 case GAIM_PROTO_OSCAR:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
587 gaim_account_set_string(account, "server", p->value[0]);
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
588 gaim_account_set_int(account, "port", atoi(p->value[1]));
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
589 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
590
5612
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
591 case GAIM_PROTO_JABBER:
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
592 gaim_account_set_string(account, "connect_server", p->value[1]);
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
593 gaim_account_set_int(account, "port", atoi(p->value[0]));
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
594 break;
9cd94a5bec8e [gaim-migrate @ 6018]
Nathan Walp <nwalp@pidgin.im>
parents: 5593
diff changeset
595
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
596 case GAIM_PROTO_MSN:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
597 case GAIM_PROTO_NAPSTER:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
598 case GAIM_PROTO_YAHOO:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
599 gaim_account_set_string(account, "server", p->value[3]);
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
600 gaim_account_set_int(account, "port", atoi(p->value[4]));
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
601 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
602
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
603 case GAIM_PROTO_IRC:
5618
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
604 if(strlen(p->value[0]) && !strchr(account->username, '@')) {
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
605 tmp = g_strdup_printf("%s@%s", account->username, p->value[0]);
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
606 gaim_account_set_username(account, tmp);
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
607 g_free(tmp);
83991299705c [gaim-migrate @ 6025]
Nathan Walp <nwalp@pidgin.im>
parents: 5612
diff changeset
608 }
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
609 gaim_account_set_int(account, "port", atoi(p->value[1]));
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
610 gaim_account_set_string(account, "charset", p->value[2]);
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
611 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
612
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
613 default:
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
614 break;
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
615 }
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
616
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
617 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
618 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
619
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
620 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
621 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
622
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
623 p = parse_line(buf, &parse_buffer);
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
624
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
625 if (strcmp(p->option, "iconfile"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
626 return account;
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
627
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
628 if (*p->value[0] != '\n' && *p->value[0] != '\0')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
629 gaim_account_set_buddy_icon(account, p->value[0]);
2317
ab8ca5d75dcd [gaim-migrate @ 2327]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
630
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
631 if (!fgets(buf, sizeof(buf), f))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
632 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
633
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
634 if (!strcmp(buf, "\t}"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
635 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
636
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
637 p = parse_line(buf, &parse_buffer);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
638
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
639 if (strcmp(p->option, "alias"))
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
640 return account;
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
641
5573
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
642 if (*p->value[0] != '\n' && *p->value[0] != '\0')
5e7de337a053 [gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents: 5568
diff changeset
643 gaim_account_set_alias(account, p->value[0]);
3205
332df87cf3d6 [gaim-migrate @ 3222]
Sean Egan <seanegan@gmail.com>
parents: 3099
diff changeset
644
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
645 if (!fgets(buf, sizeof(buf), f))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
646 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
647
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
648 if (!strcmp(buf, "\t}"))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
649 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
650
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
651 p = parse_line(buf, &parse_buffer);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
652
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
653 if (strcmp(p->option, "proxy_opts"))
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
654 return account;
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
655
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
656 if(atoi(p->value[0]) != PROXY_USE_GLOBAL) {
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
657 account->gpi = g_new0(struct gaim_proxy_info, 1);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
658 account->gpi->proxytype = atoi(p->value[0]);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
659 g_snprintf(account->gpi->proxyhost, sizeof(account->gpi->proxyhost),
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
660 "%s", p->value[1]);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
661 account->gpi->proxyport = atoi(p->value[2]);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
662 g_snprintf(account->gpi->proxyuser, sizeof(account->gpi->proxyuser),
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
663 "%s", p->value[3]);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
664 g_snprintf(account->gpi->proxypass, sizeof(account->gpi->proxypass),
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
665 "%s", p->value[4]);
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
666 }
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
667
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4480
diff changeset
668 return account;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
669
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 static void gaimrc_read_users(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 char buf[2048];
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
675 GaimAccount *account = NULL;
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
676 struct parse parse_buffer;
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
677 struct parse *p=NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679 buf[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
681 while (fgets(buf, sizeof(buf), f)) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 continue;
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
684 else if(buf[0] == '}')
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
685 break;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
686
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
687 p = parse_line(buf, &parse_buffer);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
689 if (strcmp(p->option, "user")==0 ||
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
690 strcmp(p->option, "current_user")==0) {
5580
86456ec3ca25 [gaim-migrate @ 5984]
Christian Hammond <chipx86@chipx86.com>
parents: 5573
diff changeset
691 if((account=gaimrc_read_user(f))==NULL) {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
692 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
693 "Error reading in users from .gaimrc\n");
4410
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
694 return;
61c9c2bd2a9c [gaim-migrate @ 4683]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4405
diff changeset
695 }
159
d56878f647fb [gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
696 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
700 struct replace {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
701 int old;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
702 guint *val;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
703 int new;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
704 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
706 static struct replace gen_replace[] = {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
707 { /* OPT_GEN_ENTER_SENDS */ 0x00000001, &convo_options, OPT_CONVO_ENTER_SENDS },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
708 { /* OPT_GEN_POPUP_WINDOWS */ 0x00000020, &im_options, OPT_IM_POPUP },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
709 { /* OPT_GEN_SEND_LINKS */ 0x00000040, &convo_options, OPT_CONVO_SEND_LINKS },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
710 { /* OPT_GEN_DEBUG */ 0x00000100, &misc_options, OPT_MISC_DEBUG },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
711 { /* OPT_GEN_BROWSER_POPUP */ 0x00000800, &misc_options, OPT_MISC_BROWSER_POPUP },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
712 { /* OPT_GEN_CHECK_SPELLING */ 0x00008000, &convo_options, OPT_CONVO_CHECK_SPELLING },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
713 { /* OPT_GEN_POPUP_CHAT */ 0x00010000, &chat_options, OPT_CHAT_POPUP },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
714 { /* OPT_GEN_BACK_ON_IM */ 0x00020000, &away_options, OPT_AWAY_BACK_ON_IM },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
715 { /* OPT_GEN_CTL_CHARS */ 0x00080000, &convo_options, OPT_CONVO_CTL_CHARS },
3792
2567aabdf624 [gaim-migrate @ 3932]
Rob Flynn <gaim@robflynn.com>
parents: 3717
diff changeset
716 #if 0
5248
d635e8fe2fba [gaim-migrate @ 5620]
Mark Doliner <mark@kingant.net>
parents: 5211
diff changeset
717 { /* OPT_GEN_TOMBSTONE */ 0x00100000, &away_options, OPT_AWAY_TOMBSTONE },
3792
2567aabdf624 [gaim-migrate @ 3932]
Rob Flynn <gaim@robflynn.com>
parents: 3717
diff changeset
718 #endif
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
719 { /* OPT_GEN_CTL_SMILEYS */ 0x00200000, &convo_options, OPT_CONVO_CTL_SMILEYS },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
720 { /* OPT_GEN_AUTO_AWAY */ 0x00800000, &away_options, OPT_AWAY_AUTO },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
721 { /* OPT_GEN_ESC_CAN_CLOSE */ 0x01000000, &convo_options, OPT_CONVO_ESC_CAN_CLOSE },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
722 { /* OPT_GEN_CTL_ENTER */ 0x02000000, &convo_options, OPT_CONVO_CTL_ENTER },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
723 { /* OPT_GEN_F2_TOGGLES */ 0x04000000, &convo_options, OPT_CONVO_F2_TOGGLES },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
724 { /* OPT_GEN_NO_AUTO_RESP */ 0x08000000, &away_options, OPT_AWAY_NO_AUTO_RESP },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
725 { /* OPT_GEN_QUEUE_WHEN_AWAY */ 0x10000000, &away_options, OPT_AWAY_QUEUE },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
726 { 0,NULL,0 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
727 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
729 #define OPT_GEN_LOG_ALL 0x00000004
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
730 #define OPT_GEN_STRIP_HTML 0x00000008
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
731
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
732 static struct replace disp_replace[] = {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
733 { /* OPT_DISP_SHOW_TIME */ 0x00000001, &convo_options, OPT_CONVO_SHOW_TIME },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
734 { /* OPT_DISP_SHOW_GRPNUM */ 0x00000002, &blist_options, OPT_BLIST_SHOW_GRPNUM },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
735 { /* OPT_DISP_SHOW_PIXMAPS */ 0x00000004, &blist_options, OPT_BLIST_SHOW_PIXMAPS },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
736 { /* OPT_DISP_SHOW_IDLETIME */ 0x00000008, &blist_options, OPT_BLIST_SHOW_IDLETIME },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
737 { /* OPT_DISP_SHOW_BUTTON_XPM */ 0x00000010, &blist_options, OPT_BLIST_SHOW_BUTTON_XPM },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
738 { /* OPT_DISP_IGNORE_COLOUR */ 0x00000020, &convo_options, OPT_CONVO_IGNORE_COLOUR },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
739 { /* OPT_DISP_SHOW_LOGON */ 0x00000040, &im_options, OPT_IM_LOGON },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
740 { /* OPT_DISP_SHOW_SMILEY */ 0x00000100, &convo_options, OPT_CONVO_SHOW_SMILEY },
3903
7a36590e9fdb [gaim-migrate @ 4056]
Rob Flynn <gaim@robflynn.com>
parents: 3902
diff changeset
741 { /* OPT_DISP_COOL_LOOK */ 0x00000400, &misc_options, 0},
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
742 { /* OPT_DISP_CHAT_LOGON */ 0x00000800, &chat_options, OPT_CHAT_LOGON },
4944
5fe846b7603f [gaim-migrate @ 5278]
Sean Egan <seanegan@gmail.com>
parents: 4898
diff changeset
743 { /* OPT_DISP_NO_BUTTONS */ 0x00002000, &blist_options, OPT_BLIST_NO_BUTTON_TEXT },
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
744 { /* OPT_DISP_CONV_BUTTON_TEXT */ 0x00004000, &im_options, OPT_IM_BUTTON_TEXT },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
745 { /* OPT_DISP_CHAT_BUTTON_TEXT */ 0x00008000, &chat_options, OPT_CHAT_BUTTON_TEXT },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
746 { /* OPT_DISP_NO_MT_GRP */ 0x00040000, &blist_options, OPT_BLIST_NO_MT_GRP },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
747 { /* OPT_DISP_CONV_BUTTON_XPM */ 0x00080000, &im_options, OPT_IM_BUTTON_XPM },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
748 { /* OPT_DISP_CHAT_BUTTON_XPM */ 0x00100000, &chat_options, OPT_CHAT_BUTTON_XPM },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
749 { /* OPT_DISP_SHOW_WARN */ 0x00200000, &blist_options, OPT_BLIST_SHOW_WARN },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
750 { /* OPT_DISP_IGNORE_FONTS */ 0x00400000, &convo_options, OPT_CONVO_IGNORE_FONTS },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
751 { /* OPT_DISP_IGNORE_SIZES */ 0x00800000, &convo_options, OPT_CONVO_IGNORE_SIZES },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
752 { /* OPT_DISP_ONE_WINDOW */ 0x01000000, &im_options, OPT_IM_ONE_WINDOW },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
753 { /* OPT_DISP_ONE_CHAT_WINDOW */ 0x02000000, &chat_options, OPT_CHAT_ONE_WINDOW },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
754 { /* OPT_DISP_CONV_SIDE_TAB */ 0x04000000, &im_options, OPT_IM_SIDE_TAB },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
755 { /* OPT_DISP_CONV_BR_TAB */ 0x08000000, &im_options, OPT_IM_BR_TAB },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
756 { /* OPT_DISP_CHAT_SIDE_TAB */ 0x10000000, &chat_options, OPT_CHAT_SIDE_TAB },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
757 { /* OPT_DISP_CHAT_BR_TAB */ 0x20000000, &chat_options, OPT_CHAT_BR_TAB },
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
758 { 0,NULL,0 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
759 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761 static void gaimrc_read_options(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
764 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
765 struct parse *p;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
766 gboolean read_logging = FALSE, read_general = FALSE, read_display = FALSE;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
767 int general_options = 0, display_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
768 int i;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
769
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
770 buf[0] = 0;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
771
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
772 while (buf[0] != '}') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
775
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
779 p = parse_line(buf, &parse_buffer);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
780
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
781 if (!strcmp(p->option, "general_options")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
782 general_options = atoi(p->value[0]);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
783 read_general = TRUE;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
784 } else if (!strcmp(p->option, "display_options")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
785 display_options = atoi(p->value[0]);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
786 read_display = TRUE;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
787 } else if (!strcmp(p->option, "misc_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
788 misc_options = atoi(p->value[0]);
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
789 } else if (!strcmp(p->option, "logging_options")) {
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
790 logging_options = atoi(p->value[0]);
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
791 read_logging = TRUE;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
792 } else if (!strcmp(p->option, "blist_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
793 blist_options = atoi(p->value[0]);
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
794 } else if (!strcmp(p->option, "convo_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
795 convo_options = atoi(p->value[0]);
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
796 } else if (!strcmp(p->option, "im_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
797 im_options = atoi(p->value[0]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
798
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
799 gaim_prefs_set_bool("/gaim/gtk/conversations/hide_im_on_send",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
800 (im_options & OPT_IM_POPDOWN));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
801
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
802 } else if (!strcmp(p->option, "conv_placement")) {
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
803 conv_placement_option = atoi(p->value[0]);
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
804 gaim_conv_placement_set_active(conv_placement_option);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
805 } else if (!strcmp(p->option, "chat_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
806 chat_options = atoi(p->value[0]);
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
807 } else if (!strcmp(p->option, "font_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
808 font_options = atoi(p->value[0]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
809
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
810 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
811 (font_options & OPT_FONT_BOLD));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
812 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
813 (font_options & OPT_FONT_ITALIC));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
814 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
815 (font_options & OPT_FONT_UNDERLINE));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
816 gaim_prefs_set_bool("/gaim/gtk/conversations/send_strikethrough",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
817 (font_options & OPT_FONT_STRIKE));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
818 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_font",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
819 (font_options & OPT_FONT_FACE));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
820 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_size",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
821 (font_options & OPT_FONT_SIZE));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
822 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_fgcolor",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
823 (font_options & OPT_FONT_FGCOL));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
824 gaim_prefs_set_bool("/gaim/gtk/conversations/use_custom_bgcolor",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
825 (font_options & OPT_FONT_BGCOL));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
826
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
827 } else if (!strcmp(p->option, "sound_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
828 sound_options = atoi(p->value[0]);
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
829 gaim_sound_change_output_method();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
830 } else if (!strcmp(p->option, "away_options")) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
831 away_options = atoi(p->value[0]);
2906
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2777
diff changeset
832 away_resend = atoi(p->value[1]);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
833 } else if (!strcmp(p->option, "font_face")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
834 gaim_prefs_set_string("/gaim/gtk/conversations/font_face",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
835 p->value[0]);
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1420
diff changeset
836 } else if (!strcmp(p->option, "font_size")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
837 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
838 } else if (!strcmp(p->option, "foreground")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
839 char buf[8];
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
840 fgcolor.red = atoi(p->value[0]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
841 fgcolor.green = atoi(p->value[1]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
842 fgcolor.blue = atoi(p->value[2]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
843
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
844 g_snprintf(buf, sizeof(buf), "#%2x%2x%2x",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
845 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
846 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
847
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
848 } else if (!strcmp(p->option, "background")) {
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
849 char buf[8];
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
850 bgcolor.red = atoi(p->value[0]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
851 bgcolor.green = atoi(p->value[1]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
852 bgcolor.blue = atoi(p->value[2]);
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
853
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
854 g_snprintf(buf, sizeof(buf), "#%2x%2x%2x",
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
855 atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
856 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5537
diff changeset
857
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
858 } else if (!strcmp(p->option, "report_idle")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
859 report_idle = atoi(p->value[0]);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
860 } else if (!strcmp(p->option, "web_browser")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
861 web_browser = atoi(p->value[0]);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
862 } else if (!strcmp(p->option, "web_command")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
863 strcpy(web_command, p->value[0]);
4288
a723d060620a [gaim-migrate @ 4541]
Sean Egan <seanegan@gmail.com>
parents: 4227
diff changeset
864 } else if (!strcmp(p->option, "smiley_theme")) {
a723d060620a [gaim-migrate @ 4541]
Sean Egan <seanegan@gmail.com>
parents: 4227
diff changeset
865 load_smiley_theme(p->value[0], TRUE);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
866 } else if (!strcmp(p->option, "conv_size")) {
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
867 conv_size.width = atoi(p->value[0]);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
868 conv_size.height = atoi(p->value[1]);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
869 conv_size.entry_height = atoi(p->value[2]);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
870 } else if (!strcmp(p->option, "buddy_chat_size")) {
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
871 buddy_chat_size.width = atoi(p->value[0]);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
872 buddy_chat_size.height = atoi(p->value[1]);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
873 buddy_chat_size.entry_height = atoi(p->value[2]);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
874 } else if (!strcmp(p->option, "blist_pos")) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
875 blist_pos.x = atoi(p->value[0]);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
876 blist_pos.y = atoi(p->value[1]);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
877 blist_pos.width = atoi(p->value[2]);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
878 blist_pos.height = atoi(p->value[3]);
5422
af62169c74fd [gaim-migrate @ 5801]
Sean Egan <seanegan@gmail.com>
parents: 5337
diff changeset
879 } else if (!strcmp(p->option, "sort_method")) {
5560
b7319c094153 [gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents: 5554
diff changeset
880 gaim_prefs_set_string("/gaim/gtk/blist/sort_type", p->value[0]);
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 44
diff changeset
881 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
883 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2580
diff changeset
885 /* this is where we do bugs and compatibility stuff */
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
886 if (!(sound_options & (OPT_SOUND_BEEP | OPT_SOUND_NORMAL | OPT_SOUND_ESD
4592
b69bbf9b1044 [gaim-migrate @ 4876]
Nathan Walp <nwalp@pidgin.im>
parents: 4589
diff changeset
887 | OPT_SOUND_ARTS | OPT_SOUND_NAS | OPT_SOUND_CMD))) {
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
888 sound_options |= OPT_SOUND_NORMAL;
4592
b69bbf9b1044 [gaim-migrate @ 4876]
Nathan Walp <nwalp@pidgin.im>
parents: 4589
diff changeset
889 gaim_sound_change_output_method();
b69bbf9b1044 [gaim-migrate @ 4876]
Nathan Walp <nwalp@pidgin.im>
parents: 4589
diff changeset
890 }
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2580
diff changeset
891
2352
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
892 if (conv_size.width == 0 &&
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
893 conv_size.height == 0 &&
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
894 conv_size.entry_height == 0) {
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3630
diff changeset
895 conv_size.width = 410;
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3630
diff changeset
896 conv_size.height = 160;
2352
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
897 conv_size.entry_height = 50;
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
898 }
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
899
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
900 if (buddy_chat_size.width == 0 &&
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
901 buddy_chat_size.height == 0 &&
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
902 buddy_chat_size.entry_height == 0) {
3671
0f468c22c702 [gaim-migrate @ 3801]
Rob Flynn <gaim@robflynn.com>
parents: 3630
diff changeset
903 buddy_chat_size.width = 410;
2352
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
904 buddy_chat_size.height = 160;
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
905 buddy_chat_size.entry_height = 50;
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
906 }
39e66e80bb31 [gaim-migrate @ 2365]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2317
diff changeset
907
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
908 if (read_general) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
909 if (!read_logging) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
910 logging_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
911 if (general_options & OPT_GEN_LOG_ALL)
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
912 logging_options |= OPT_LOG_CONVOS | OPT_LOG_CHATS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
913 if (general_options & OPT_GEN_STRIP_HTML)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
914 logging_options |= OPT_LOG_STRIP_HTML;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
915 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
916 for (i = 0; gen_replace[i].val; i++)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
917 if (general_options & gen_replace[i].old)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
918 *gen_replace[i].val |= gen_replace[i].new;
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
919 }
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
920
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
921 if (read_display)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
922 for (i = 0; disp_replace[i].val; i++)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
923 if (display_options & disp_replace[i].old)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
924 *disp_replace[i].val |= disp_replace[i].new;
2906
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2777
diff changeset
925
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2777
diff changeset
926 if (!away_resend)
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2777
diff changeset
927 away_resend = 120;
3391
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
928
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
929 if (misc_options & OPT_MISC_BUDDY_TICKER) {
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
930 if (gaim_plugins_enabled()) {
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
931 gchar* buf;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
932
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
933 buf = g_strconcat(LIBDIR, G_DIR_SEPARATOR_S,
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
934 #ifndef _WIN32
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
935 "ticker.so",
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
936 #else
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
937 "ticker.dll",
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
938 #endif
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
939 NULL);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
940
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
941 gaim_plugin_load(gaim_plugin_probe(buf));
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
942 g_free(buf);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
943 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
944
3391
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
945 misc_options &= ~OPT_MISC_BUDDY_TICKER;
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
946 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
947 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
948
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
949 static void gaimrc_read_sounds(FILE *f)
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
950 {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
951 int i;
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
952 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
953 struct parse parse_buffer;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
954 struct parse *p;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
955
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
956 buf[0] = 0;
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
957
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
958 for(i=0; i<GAIM_NUM_SOUNDS; i++)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
959 gaim_sound_set_event_file(i, NULL);
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
960
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
961 while (buf[0] != '}') {
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
962 if (buf[0] == '#')
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
963 continue;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
964
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
965 if (!fgets(buf, sizeof(buf), f))
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
966 return;
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
967
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
968 p = parse_line(buf, &parse_buffer);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
969 #ifndef _WIN32
1214
0baf39dc5437 [gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1209
diff changeset
970 if (!strcmp(p->option, "sound_cmd")) {
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
971 gaim_sound_set_command(p->value[0]);
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
972 } else
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
973 #endif
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
974 if (!strncmp(p->option, "sound", strlen("sound"))) {
2036
ab15b91b93d8 [gaim-migrate @ 2046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1976
diff changeset
975 i = p->option[strlen("sound")] - 'A';
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
976
1214
0baf39dc5437 [gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1209
diff changeset
977 if (p->value[0][0])
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
978 gaim_sound_set_event_file(i, p->value[0]);
1214
0baf39dc5437 [gaim-migrate @ 1224]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1209
diff changeset
979 }
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
980 }
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
981 }
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
982
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
983 static gboolean gaimrc_parse_proxy_uri(const char *proxy)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
984 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
985 char *c, *d;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
986 char buffer[2048];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
987
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
988 char host[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
989 char user[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
990 char pass[128];
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
991 int port = 0;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
992 int len = 0;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
993
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
994 host[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
995 user[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
996 pass[0] = '\0';
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
997
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
998 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
999 "gaimrc_parse_proxy_uri(%s)\n", proxy);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1000
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1001 if ((c = strchr(proxy, ':')) == NULL)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1002 {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1003 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1004 "No URI detected.\n");
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1005 /* No URI detected. */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1006 return FALSE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1007 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1008
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1009 len = c - proxy;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1010
5537
3becf79500d2 [gaim-migrate @ 5937]
Mark Doliner <mark@kingant.net>
parents: 5534
diff changeset
1011 if (strncmp(proxy, "http://", len + 3))
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1012 return FALSE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1013
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1014 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "Found HTTP proxy.\n");
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1015 /* Get past "://" */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1016 c += 3;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1017
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1018 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
1019
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1020 for (;;)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1021 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1022 *buffer = '\0';
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1023 d = buffer;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1024
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1025 while (*c != '\0' && *c != '@' && *c != ':' && *c != '/')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1026 *d++ = *c++;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1027
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1028 *d = '\0';
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1029
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1030 if (*c == ':')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1031 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1032 /*
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1033 * 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
1034 * If not, host.
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1035 */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1036 if (strchr(c, '@') != NULL)
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1037 strcpy(user, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1038 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1039 strcpy(host, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1040 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1041 else if (*c == '@')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1042 {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1043 if (user[0] == '\0')
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1044 strcpy(user, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1045 else
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1046 strcpy(pass, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1047 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1048 else if (*c == '/' || *c == '\0')
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1049 {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1050 if (host[0] == '\0')
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1051 strcpy(host, buffer);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1052 else
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1053 port = atoi(buffer);
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1054
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1055 /* Done. */
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1056 break;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1057 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1058
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1059 c++;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1060 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1061
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1062 /* NOTE: HTTP_PROXY takes precendence. */
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1063 if (host[0])
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1064 strcpy(global_proxy_info.proxyhost, host);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1065 else
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1066 *global_proxy_info.proxyhost = '\0';
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1067
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1068 if (user[0])
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1069 strcpy(global_proxy_info.proxyuser, user);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1070 else
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1071 *global_proxy_info.proxyuser = '\0';
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1072
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1073 if (pass[0])
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1074 strcpy(global_proxy_info.proxypass, pass);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1075 else
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1076 *global_proxy_info.proxypass = '\0';
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1077
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1078 global_proxy_info.proxyport = port;
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1079
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1080 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1081 "Host: '%s', User: '%s', Password: '%s', Port: %d\n",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1082 global_proxy_info.proxyhost, global_proxy_info.proxyuser,
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1083 global_proxy_info.proxypass, global_proxy_info.proxyport);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1084
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1085 return TRUE;
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1086 }
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1087
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1088 static void gaimrc_read_proxy(FILE *f)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1089 {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1090 char buf[2048];
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1091 struct parse parse_buffer;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1092 struct parse *p;
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1093
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1094 buf[0] = 0;
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1095 global_proxy_info.proxyhost[0] = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1096 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "gaimrc_read_proxy\n");
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1097
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1098 while (buf[0] != '}') {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1099 if (buf[0] == '#')
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1100 continue;
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1101
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1102 if (!fgets(buf, sizeof(buf), f))
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1103 return;
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1104
3493
4b204c262376 [gaim-migrate @ 3553]
Luke Schierer <lschiere@pidgin.im>
parents: 3473
diff changeset
1105 p = parse_line(buf, &parse_buffer);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1106
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1107 if (!strcmp(p->option, "host")) {
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1108 g_snprintf(global_proxy_info.proxyhost,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1109 sizeof(global_proxy_info.proxyhost), "%s", p->value[0]);
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1110 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1111 "Set proxyhost %s\n", global_proxy_info.proxyhost);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1112 } else if (!strcmp(p->option, "port")) {
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1113 global_proxy_info.proxyport = atoi(p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1114 } else if (!strcmp(p->option, "type")) {
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1115 global_proxy_info.proxytype = atoi(p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1116 } else if (!strcmp(p->option, "user")) {
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1117 g_snprintf(global_proxy_info.proxyuser,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1118 sizeof(global_proxy_info.proxyuser), "%s", p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1119 } else if (!strcmp(p->option, "pass")) {
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1120 g_snprintf(global_proxy_info.proxypass,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1121 sizeof(global_proxy_info.proxypass), "%s", p->value[0]);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1122 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1123 }
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1124 if (global_proxy_info.proxyhost[0])
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1125 proxy_info_is_from_gaimrc = 1;
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1126 else {
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1127 gboolean getVars = TRUE;
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1128 proxy_info_is_from_gaimrc = 0;
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1129
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1130 if (g_getenv("HTTP_PROXY"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1131 g_snprintf(global_proxy_info.proxyhost,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1132 sizeof(global_proxy_info.proxyhost), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1133 g_getenv("HTTP_PROXY"));
1938
c9db54d8d8dc [gaim-migrate @ 1948]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1936
diff changeset
1134 else if (g_getenv("http_proxy"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1135 g_snprintf(global_proxy_info.proxyhost,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1136 sizeof(global_proxy_info.proxyhost), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1137 g_getenv("http_proxy"));
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1138 else if (g_getenv("HTTPPROXY"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1139 g_snprintf(global_proxy_info.proxyhost,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1140 sizeof(global_proxy_info.proxyhost), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1141 g_getenv("HTTPPROXY"));
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1142
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1143 if (*global_proxy_info.proxyhost != '\0')
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1144 getVars = !gaimrc_parse_proxy_uri(global_proxy_info.proxyhost);
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1145
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1146 if (getVars)
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1147 {
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1148 if (g_getenv("HTTP_PROXY_PORT"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1149 global_proxy_info.proxyport = atoi(g_getenv("HTTP_PROXY_PORT"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1150 else if (g_getenv("http_proxy_port"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1151 global_proxy_info.proxyport = atoi(g_getenv("http_proxy_port"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1152 else if (g_getenv("HTTPPROXYPORT"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1153 global_proxy_info.proxyport = atoi(g_getenv("HTTPPROXYPORT"));
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1154
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1155 if (g_getenv("HTTP_PROXY_USER"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1156 g_snprintf(global_proxy_info.proxyuser,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1157 sizeof(global_proxy_info.proxyuser), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1158 g_getenv("HTTP_PROXY_USER"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1159 else if (g_getenv("http_proxy_user"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1160 g_snprintf(global_proxy_info.proxyuser,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1161 sizeof(global_proxy_info.proxyuser), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1162 g_getenv("http_proxy_user"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1163 else if (g_getenv("HTTPPROXYUSER"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1164 g_snprintf(global_proxy_info.proxyuser,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1165 sizeof(global_proxy_info.proxyuser), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1166 g_getenv("HTTPPROXYUSER"));
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1167
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1168 if (g_getenv("HTTP_PROXY_PASS"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1169 g_snprintf(global_proxy_info.proxypass,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1170 sizeof(global_proxy_info.proxypass), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1171 g_getenv("HTTP_PROXY_PASS"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1172 else if (g_getenv("http_proxy_pass"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1173 g_snprintf(global_proxy_info.proxypass,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1174 sizeof(global_proxy_info.proxypass), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1175 g_getenv("http_proxy_pass"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1176 else if (g_getenv("HTTPPROXYPASS"))
4634
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1177 g_snprintf(global_proxy_info.proxypass,
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1178 sizeof(global_proxy_info.proxypass), "%s",
d19872836812 [gaim-migrate @ 4941]
Nathan Walp <nwalp@pidgin.im>
parents: 4596
diff changeset
1179 g_getenv("HTTPPROXYPASS"));
3435
583e33f3952e [gaim-migrate @ 3465]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1180 }
1936
f0b54f592486 [gaim-migrate @ 1946]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1921
diff changeset
1181 }
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1182 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1183
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1184 static void set_defaults()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1185 {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1186 int i;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1187 struct away_message *a;
917
f3c23b3c1ed7 [gaim-migrate @ 927]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1188
4227
a614423c648f [gaim-migrate @ 4471]
Mark Doliner <mark@kingant.net>
parents: 4201
diff changeset
1189 misc_options =
a614423c648f [gaim-migrate @ 4471]
Mark Doliner <mark@kingant.net>
parents: 4201
diff changeset
1190 OPT_MISC_USE_SERVER_ALIAS;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1191
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1192 logging_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1193
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1194 blist_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1195 OPT_BLIST_SHOW_GRPNUM |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1196 OPT_BLIST_SHOW_PIXMAPS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1197 OPT_BLIST_SHOW_IDLETIME |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1198 OPT_BLIST_GREY_IDLERS |
4962
b6fd57ba76e8 [gaim-migrate @ 5296]
Sean Egan <seanegan@gmail.com>
parents: 4944
diff changeset
1199 OPT_BLIST_SHOW_BUTTON_XPM |
b6fd57ba76e8 [gaim-migrate @ 5296]
Sean Egan <seanegan@gmail.com>
parents: 4944
diff changeset
1200 OPT_BLIST_SHOW_ICONS;
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 774
diff changeset
1201
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1202 convo_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1203 OPT_CONVO_ENTER_SENDS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1204 OPT_CONVO_SEND_LINKS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1205 OPT_CONVO_CTL_CHARS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1206 OPT_CONVO_CTL_SMILEYS |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1207 OPT_CONVO_SHOW_TIME |
3919
82d3edd659cb [gaim-migrate @ 4082]
Sean Egan <seanegan@gmail.com>
parents: 3903
diff changeset
1208 OPT_CONVO_SHOW_SMILEY |
82d3edd659cb [gaim-migrate @ 4082]
Sean Egan <seanegan@gmail.com>
parents: 3903
diff changeset
1209 OPT_CONVO_CHECK_SPELLING;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1210
4469
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
1211 conv_placement_option = 0;
d76095396a0e [gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents: 4430
diff changeset
1212
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1213 im_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1214 OPT_IM_LOGON |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1215 OPT_IM_BUTTON_XPM |
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1216 OPT_IM_ONE_WINDOW ;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1217
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1218 chat_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1219 OPT_CHAT_LOGON |
2388
5a7234d5e052 [gaim-migrate @ 2401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2383
diff changeset
1220 OPT_CHAT_BUTTON_XPM |
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1221 OPT_CHAT_TAB_COMPLETE |
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3309
diff changeset
1222 OPT_CHAT_ONE_WINDOW;
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 774
diff changeset
1223
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1224 font_options = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1225
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1226 away_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1227 OPT_AWAY_BACK_ON_IM;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1228
4561
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1229 for (i = 0; i < GAIM_NUM_SOUNDS; i++)
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1230 gaim_sound_set_event_file(i, NULL);
9df99116840a [gaim-migrate @ 4842]
Nathan Walp <nwalp@pidgin.im>
parents: 4512
diff changeset
1231
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1232 font_options = 0;
2580
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1233 /* 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
1234 available one will be used. */
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1235 sound_options =
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1236 OPT_SOUND_LOGIN |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1237 OPT_SOUND_LOGOUT |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1238 OPT_SOUND_RECV |
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1239 OPT_SOUND_SEND |
2580
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2397
diff changeset
1240 OPT_SOUND_SILENT_SIGNON |
4581
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
1241 OPT_SOUND_NORMAL |
4b1e24835bbf [gaim-migrate @ 4864]
Nathan Walp <nwalp@pidgin.im>
parents: 4561
diff changeset
1242 OPT_SOUND_NAS;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1243
2990
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1244 #ifdef USE_SCREENSAVER
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1245 report_idle = IDLE_SCREENSAVER;
2990
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1246 #else
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1247 report_idle = IDLE_GAIM;
06f2bae259a0 [gaim-migrate @ 3003]
Rob Flynn <gaim@robflynn.com>
parents: 2908
diff changeset
1248 #endif
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1249 web_browser = BROWSER_NETSCAPE;
3434
0c281a80767d [gaim-migrate @ 3463]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1250 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
1251
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1252 auto_away = 10;
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1253 a = g_new0(struct away_message, 1);
4589
eddb870a3c4d [gaim-migrate @ 4873]
Luke Schierer <lschiere@pidgin.im>
parents: 4581
diff changeset
1254 g_snprintf(a->name, sizeof(a->name), _("boring default"));
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1255 g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1256 away_messages = g_slist_append(away_messages, a);
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1257 default_away = a;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1258
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1259 blist_pos.width = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1260 blist_pos.height = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1261 blist_pos.x = 0;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1262 blist_pos.y = 0;
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
1263
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1264 conv_size.width = 320;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1265 conv_size.height = 175;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1266 conv_size.entry_height = 50;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1267
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1268 buddy_chat_size.width = 320;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1269 buddy_chat_size.height = 160;
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1270 buddy_chat_size.entry_height = 50;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1273 void load_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 FILE *f;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 char buf[1024];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 int ver = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1278
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1279 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "Loading preferences.\n");
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1280
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1281 if (is_saving_prefs) {
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1282 request_load_prefs = 1;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1283 gaim_debug(GAIM_DEBUG_INFO, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1284 "Currently saving. Will request load.\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1285 return;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1286 }
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
1287
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1288 if (opt_rcfile_arg)
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1289 g_snprintf(buf, sizeof(buf), "%s", opt_rcfile_arg);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1290 else if (gaim_home_dir())
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3563
diff changeset
1291 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
1292 else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1293 set_defaults();
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1294 return;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1295 }
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1296
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1297 if ((f = fopen(buf, "r"))) {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1298 is_loading_prefs = 1;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1299 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "start load_prefs\n");
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1300 fgets(buf, sizeof(buf), f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1301 sscanf(buf, "# .gaimrc v%d", &ver);
2389
021ba044ab0b [gaim-migrate @ 2402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2388
diff changeset
1302 if ((ver <= 3) || (buf[0] != '#'))
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2286
diff changeset
1303 set_defaults();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1304
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1305 while (!feof(f)) {
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1306 int tag = gaimrc_parse_tag(f);
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1307 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1308 "starting read tag %d\n", tag);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1309 switch (tag) {
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1310 case -1:
5514
5664dbaf670c [gaim-migrate @ 5913]
Mark Doliner <mark@kingant.net>
parents: 5442
diff changeset
1311 /* Do nothing--either EOF or empty line */
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1312 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1313 case 0:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1314 gaimrc_read_users(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1315 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1316 case 1:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1317 gaimrc_read_options(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1318 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1319 case 2:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1320 gaimrc_read_away(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1321 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1322 case 3:
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1323 if (gaim_plugins_enabled())
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1324 gaimrc_read_plugins(f);
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1325 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1326 case 4:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1327 gaimrc_read_pounce(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1328 break;
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1329 case 6:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1330 gaimrc_read_sounds(f);
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1331 break;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1332 case 7:
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1333 gaimrc_read_proxy(f);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1878
diff changeset
1334 break;
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1335 default:
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1336 /* NOOP */
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1337 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1338 }
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1339 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1340 "ending read tag %d\n", tag);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341 }
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1342 fclose(f);
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1343 is_loading_prefs = 0;
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1344 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", "end load_prefs\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1345 if (request_save_prefs) {
5211
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1346 gaim_debug(GAIM_DEBUG_INFO, "gaimrc",
0241d6b6702d [gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
1347 "Saving preferences on request\n");
4137
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1348 request_save_prefs = 0;
22875a399312 [gaim-migrate @ 4355]
Luke Schierer <lschiere@pidgin.im>
parents: 4122
diff changeset
1349 }
1560
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1350 } else if (opt_rcfile_arg) {
72235e3fcff6 [gaim-migrate @ 1570]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1351 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
1352 gaim_notify_error(NULL, NULL, buf, NULL);
2383
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1353 set_defaults();
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1354 } else {
3d4bbadf4b8d [gaim-migrate @ 2396]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1355 set_defaults();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1356 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1357
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5109
diff changeset
1358 prefs_initial_load = 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1359 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1360
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1361 void save_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1362 {
5560
b7319c094153 [gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents: 5554
diff changeset
1363 gaim_debug(GAIM_DEBUG_INFO, "gaimrc", "save_prefs() called. Rejected!\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1364 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1365
1209
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1366
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1367 /* 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
1368 * being compared to the rest of the items on the list.
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1369 */
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1370
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1371 gint sort_awaymsg_list(gconstpointer a, gconstpointer b)
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1372 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1373 struct away_message *msg_a;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1374 struct away_message *msg_b;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1375
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1376 msg_a = (struct away_message *)a;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1377 msg_b = (struct away_message *)b;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1378
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1379 return (strcmp(msg_a->name, msg_b->name));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1236
diff changeset
1380
1209
7aec3f881c98 [gaim-migrate @ 1219]
Rob Flynn <gaim@robflynn.com>
parents: 1155
diff changeset
1381 }
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1382
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1383 void
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1384 load_pounces()
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1385 {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1386 GList *l;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1387 struct pounce_placeholder *ph;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1388 struct gaim_pounce *pounce;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
1389 GaimAccount *account;
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1390
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1391 for (l = buddy_pounces; l != NULL; l = l->next) {
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1392 GaimPounceEvent events = GAIM_POUNCE_NONE;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1393 GaimGtkPounceAction actions = GAIM_GTKPOUNCE_NONE;
5035
628681ec8a5e [gaim-migrate @ 5378]
Luke Schierer <lschiere@pidgin.im>
parents: 5032
diff changeset
1394 ph = (struct pounce_placeholder *)l->data;
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1395
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1396 account = gaim_account_find(ph->pouncer, ph->protocol);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1397
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1398 old_pounce_opts_to_new(ph->options, &events, &actions);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1399
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1400 pounce = gaim_gtkpounce_new(account, ph->name, events, actions,
5072
5078f765e3f9 [gaim-migrate @ 5425]
Christian Hammond <chipx86@chipx86.com>
parents: 5054
diff changeset
1401 (*ph->message == '\0' ? NULL : ph->message),
5078f765e3f9 [gaim-migrate @ 5425]
Christian Hammond <chipx86@chipx86.com>
parents: 5054
diff changeset
1402 (*ph->command == '\0' ? NULL : ph->command),
5078f765e3f9 [gaim-migrate @ 5425]
Christian Hammond <chipx86@chipx86.com>
parents: 5054
diff changeset
1403 (*ph->sound == '\0' ? NULL : ph->sound),
5078f765e3f9 [gaim-migrate @ 5425]
Christian Hammond <chipx86@chipx86.com>
parents: 5054
diff changeset
1404 (ph->options & 0x100));
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1405
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1406 g_free(ph);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1407 }
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1408
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1409 g_list_free(buddy_pounces);
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1410 buddy_pounces = NULL;
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1411
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1412 /*
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1413 * < ChipX86|Coding> why do we save prefs just after reading them?
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1414 * < faceprint> ChipX86|Coding: because we're cool like that
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1415 * <SeanEgan|Coding> damn straight
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1416 */
5593
b07aa997ddd8 [gaim-migrate @ 5997]
Christian Hammond <chipx86@chipx86.com>
parents: 5580
diff changeset
1417 /* save_prefs(); -- I like the above comment :( */
5032
cb700c07ee07 [gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents: 4985
diff changeset
1418 }