Mercurial > pidgin
comparison src/protocols/silc/util.c @ 10825:cb625efd1071
[gaim-migrate @ 12490]
Multiple account support for SILC in HEAD too
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 15 Apr 2005 01:58:22 +0000 |
parents | bf5e48215158 |
children | 07dc8c6a359f |
comparison
equal
deleted
inserted
replaced
10824:8d52201620d0 | 10825:cb625efd1071 |
---|---|
2 | 2 |
3 silcgaim_util.c | 3 silcgaim_util.c |
4 | 4 |
5 Author: Pekka Riikonen <priikone@silcnet.org> | 5 Author: Pekka Riikonen <priikone@silcnet.org> |
6 | 6 |
7 Copyright (C) 2004 Pekka Riikonen | 7 Copyright (C) 2004 - 2005 Pekka Riikonen |
8 | 8 |
9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
11 the Free Software Foundation; version 2 of the License. | 11 the Free Software Foundation; version 2 of the License. |
12 | 12 |
69 | 69 |
70 gboolean silcgaim_check_silc_dir(GaimConnection *gc) | 70 gboolean silcgaim_check_silc_dir(GaimConnection *gc) |
71 { | 71 { |
72 char filename[256], file_public_key[256], file_private_key[256]; | 72 char filename[256], file_public_key[256], file_private_key[256]; |
73 char servfilename[256], clientfilename[256], friendsfilename[256]; | 73 char servfilename[256], clientfilename[256], friendsfilename[256]; |
74 char pkd[256], prd[256]; | |
74 struct stat st; | 75 struct stat st; |
75 struct passwd *pw; | 76 struct passwd *pw; |
76 | 77 |
77 pw = getpwuid(getuid()); | 78 pw = getpwuid(getuid()); |
78 if (!pw) { | 79 if (!pw) { |
189 } | 190 } |
190 | 191 |
191 /* | 192 /* |
192 * Check Public and Private keys | 193 * Check Public and Private keys |
193 */ | 194 */ |
195 g_snprintf(pkd, sizeof(pkd), "%s" G_DIR_SEPARATOR_S "public_key.pub", silcgaim_silcdir()); | |
196 g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcgaim_silcdir()); | |
194 g_snprintf(file_public_key, sizeof(file_public_key) - 1, "%s", | 197 g_snprintf(file_public_key, sizeof(file_public_key) - 1, "%s", |
195 gaim_prefs_get_string("/plugins/prpl/silc/pubkey")); | 198 gaim_account_get_string(gc->account, "public-key", pkd)); |
196 g_snprintf(file_private_key, sizeof(file_public_key) - 1, "%s", | 199 g_snprintf(file_private_key, sizeof(file_public_key) - 1, "%s", |
197 gaim_prefs_get_string("/plugins/prpl/silc/privkey")); | 200 gaim_account_get_string(gc->account, "private-key", prd)); |
198 | 201 |
199 if ((g_stat(file_public_key, &st)) == -1) { | 202 if ((g_stat(file_public_key, &st)) == -1) { |
200 /* If file doesn't exist */ | 203 /* If file doesn't exist */ |
201 if (errno == ENOENT) { | 204 if (errno == ENOENT) { |
202 gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); | 205 gaim_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5); |
302 silc_pkcs_free(pkcs); | 305 silc_pkcs_free(pkcs); |
303 } | 306 } |
304 | 307 |
305 s = g_string_new(""); | 308 s = g_string_new(""); |
306 if (ident->realname) | 309 if (ident->realname) |
307 /* Hint for translators: Please check the tabulator width here and in | 310 /* Hint for translators: Please check the tabulator width here and in |
308 the next strings (short strings: 2 tabs, longer strings 1 tab, | 311 the next strings (short strings: 2 tabs, longer strings 1 tab, |
309 sum: 3 tabs or 24 characters) */ | 312 sum: 3 tabs or 24 characters) */ |
310 g_string_append_printf(s, _("Real Name: \t%s\n"), ident->realname); | 313 g_string_append_printf(s, _("Real Name: \t%s\n"), ident->realname); |
311 if (ident->username) | 314 if (ident->username) |
312 g_string_append_printf(s, _("User Name: \t%s\n"), ident->username); | 315 g_string_append_printf(s, _("User Name: \t%s\n"), ident->username); |
313 if (ident->email) | 316 if (ident->email) |