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