# HG changeset patch # User Mikael Berthe # Date 1165062596 -3600 # Node ID 6646d2ed7f74417ef368cbb8867ed5bfbbf31d7f # Parent a5dc85fdebdedaa53f4d5672132abb394b9efb95 Allow pgp commands in config file, update sample configuration file diff -r a5dc85fdebde -r 6646d2ed7f74 mcabber/mcabberrc.example --- a/mcabber/mcabberrc.example Sat Dec 02 13:11:44 2006 +0100 +++ b/mcabber/mcabberrc.example Sat Dec 02 13:29:56 2006 +0100 @@ -43,8 +43,9 @@ # To sign outgoing messages, select your private key id with # the pgp_private_key option. You cannot change these options once # mcabber is running. +# Note: you can get the Key Id with gpg: "gpg --list-keys --keyid-format long" #set pgp = 0 -#set pgp_private_key = "B0B92210" +#set pgp_private_key = "C9940A9BB0B92210" # # You can set your PGP passhrase here, although it's NOT advised. #set pgp_passphrase = "PGPpassword" @@ -256,6 +257,17 @@ # log window (default: 0, no) #set log_display_sender = 0 +# Contacts PGP information +# You can provide a PGP key to be used for a given Jabber user, or +# disbale PGP on a per-account basis. +# If you provide a KeyId for a contact, it will be compared to the key the +# contact uses to sign their presence/messages and it will be used for +# all outgoing encrypted messages (that is, the contact signature key will +# be ignored). +# Please note that the key must match exactly the id seen with /info. +#pgp disable foo@bar.org +#pgp setkey bar@foo.net C9940A9BB0B92210 + # Aliases alias me = say /me alias online = status online diff -r a5dc85fdebde -r 6646d2ed7f74 mcabber/src/settings.c --- a/mcabber/src/settings.c Sat Dec 02 13:11:44 2006 +0100 +++ b/mcabber/src/settings.c Sat Dec 02 13:29:56 2006 +0100 @@ -149,9 +149,10 @@ if ((*line == '\n') || (*line == '\0') || (*line == '#')) continue; - if ((strchr(line, '=') != NULL)) { - // Only accept the set, alias and bind commands + if ((strchr(line, '=') != NULL) || !strncmp(line, "pgp ", strlen("pgp "))) { + // Only accept the set, alias, bind and pgp commands if (strncmp(line, "set ", strlen("set ")) && + strncmp(line, "pgp ", strlen("pgp ")) && strncmp(line, "bind ", strlen("bind ")) && strncmp(line, "alias ", strlen("alias "))) { scr_LogPrint(LPRINT_LOGNORM,