Changeset f3597a1 for otr.c


Ignore:
Timestamp:
2008-02-14T21:01:21Z (12 years ago)
Author:
Sven Moritz Hallberg <sm@…>
Branches:
master
Children:
6c91e6e
Parents:
ef93a2f
Message:

revert keygen behaviour to old (lax) behavior

File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    ref93a2f rf3597a1  
    164164/* find a private key by fingerprint prefix (given as any number of hex strings) */
    165165OtrlPrivKey *match_privkey(irc_t *irc, const char **args);
    166 
    167 /* to log out accounts during keygen */
    168 extern void cmd_account(irc_t *irc, char **cmd);
    169166
    170167
     
    301298       
    302299    if(!g_static_rec_mutex_trylock(&ic->irc->otr_mutex)) {
    303                 irc_usermsg(ic->irc, "otr keygen in progress - msg from %s dropped",
     300                user_t *u = user_findhandle(ic, handle);
     301               
     302                /* fallback for non-otr clients */
     303                if(u && !u->encrypted) {
     304                        return g_strdup(msg);
     305                }
     306               
     307                irc_usermsg(ic->irc, "encrypted msg from %s during keygen - dropped",
    304308                        peernick(ic->irc, handle, ic->acc->prpl->name));
    305309                return NULL;
     
    350354       
    351355    if(!g_static_rec_mutex_trylock(&ic->irc->otr_mutex)) {
    352                 irc_usermsg(ic->irc, "otr keygen in progress - msg to %s not sent",
     356                user_t *u = user_findhandle(ic, handle);
     357               
     358                /* Fallback for non-otr clients.
     359                   Yes, this better shouldn't send private stuff in the clear... */
     360                if(u && !u->encrypted) {
     361                        return ic->acc->prpl->buddy_msg(ic, (char *)handle, (char *)msg, flags);
     362                }
     363               
     364                irc_usermsg(ic->irc, "encrypted message to %s during keygen - not sent",
    353365                        peernick(ic->irc, handle, ic->acc->prpl->name));
    354366                return 1;
     
    14661478void otr_keygen(irc_t *irc, const char *handle, const char *protocol)
    14671479{
    1468         char *account_off[] = {"account", "off", NULL};
    14691480        GError *err;
    14701481        GThread *thr;
    14711482        struct kgdata *kg;
    14721483        gint ev;
     1484       
     1485        irc_usermsg(irc, "generating new private key for %s/%s...", handle, protocol);
    14731486       
    14741487        kg = g_new0(struct kgdata, 1);
     
    15091522        }
    15101523
    1511         /* tell the user what's happening, go comatose, and start the keygen */
    1512         irc_usermsg(irc, "going comatose for otr key generation, this will take a moment");
    1513         irc_usermsg(irc, "all accounts logging out, user commands disabled");
    1514         cmd_account(irc, account_off);
    1515         irc_usermsg(irc, "generating new otr privkey for %s/%s...",
    1516                 handle, protocol);
    1517        
    15181524        thr = g_thread_create(&otr_keygen_thread_func, kg, FALSE, &err);
    15191525        if(!thr) {
Note: See TracChangeset for help on using the changeset viewer.