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