Changeset d0faf62


Ignore:
Timestamp:
2008-02-17T01:58:41Z (16 years ago)
Author:
Sven Moritz Hallberg <sm@…>
Branches:
master
Children:
37bff51
Parents:
82e8fe8
Message:

put 'otr forget key' back in, which now works

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    r82e8fe8 rd0faf62  
    346346                       
    347347                                <para>
    348                                         Forgets some part of our OTR userstate. Available things: fingerprint and context. See <emphasis>help otr forget &lt;thing&gt;</emphasis> for more information.
     348                                        Forgets some part of our OTR userstate. Available things: fingerprint, context, and key. See <emphasis>help otr forget &lt;thing&gt;</emphasis> for more information.
    349349                                </para>
    350350                       
     
    377377                        </bitlbee-command>
    378378
     379                        <bitlbee-command name="key">
     380                                <syntax>otr forget key &lt;fingerprint&gt;</syntax>
     381                               
     382                                <description>
     383                               
     384                                        <para>
     385                                                Forgets an OTR private key matching the specified fingerprint. It is allowed to specify only a (unique) prefix of the fingerprint.
     386                                        </para>
     387                                       
     388                                </description>
     389                               
     390                        </bitlbee-command>
     391               
    379392                </bitlbee-command>
    380393               
  • otr.c

    r82e8fe8 rd0faf62  
    127127void yes_forget_fingerprint(gpointer w, void *data);
    128128void yes_forget_context(gpointer w, void *data);
     129void yes_forget_key(gpointer w, void *data);
    129130
    130131/* helper to make sure accountname and protocol match the incoming "opdata" */
     
    899900}
    900901
     902void yes_forget_key(gpointer w, void *data)
     903{
     904        OtrlPrivKey *key = (OtrlPrivKey *)data;
     905       
     906        otrl_privkey_forget(key);
     907}
     908
    901909void cmd_otr_forget(irc_t *irc, char **args)
    902910{
     
    972980                s = g_strdup_printf("about to forget otr data about %s, are you sure?", args[2]);
    973981                query_add(irc, NULL, s, yes_forget_context, NULL, ctx);
     982                g_free(s);
     983        }
     984       
     985        else if(!strcmp(args[1], "key"))
     986        {
     987                OtrlPrivKey *key;
     988                char *s;
     989               
     990                key = match_privkey(irc, ((const char **)args)+2);
     991                if(!key) {
     992                        /* match_privkey does error messages */
     993                        return;
     994                }
     995               
     996                s = g_strdup_printf("about to forget the private key for %s/%s, are you sure?",
     997                        key->accountname, key->protocol);
     998                query_add(irc, NULL, s, yes_forget_key, NULL, key);
    974999                g_free(s);
    9751000        }
Note: See TracChangeset for help on using the changeset viewer.