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