Changeset f3597a1
- Timestamp:
- 2008-02-14T21:01:21Z (17 years ago)
- Branches:
- master
- Children:
- 6c91e6e
- Parents:
- ef93a2f
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
ref93a2f rf3597a1 164 164 /* find a private key by fingerprint prefix (given as any number of hex strings) */ 165 165 OtrlPrivKey *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);169 166 170 167 … … 301 298 302 299 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", 304 308 peernick(ic->irc, handle, ic->acc->prpl->name)); 305 309 return NULL; … … 350 354 351 355 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", 353 365 peernick(ic->irc, handle, ic->acc->prpl->name)); 354 366 return 1; … … 1466 1478 void otr_keygen(irc_t *irc, const char *handle, const char *protocol) 1467 1479 { 1468 char *account_off[] = {"account", "off", NULL};1469 1480 GError *err; 1470 1481 GThread *thr; 1471 1482 struct kgdata *kg; 1472 1483 gint ev; 1484 1485 irc_usermsg(irc, "generating new private key for %s/%s...", handle, protocol); 1473 1486 1474 1487 kg = g_new0(struct kgdata, 1); … … 1509 1522 } 1510 1523 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 1518 1524 thr = g_thread_create(&otr_keygen_thread_func, kg, FALSE, &err); 1519 1525 if(!thr) { -
root_commands.c
ref93a2f rf3597a1 136 136 } 137 137 138 void cmd_account( irc_t *irc, char **cmd );138 static void cmd_account( irc_t *irc, char **cmd ); 139 139 140 140 static void cmd_identify( irc_t *irc, char **cmd ) … … 213 213 } 214 214 215 void cmd_account( irc_t *irc, char **cmd )215 static void cmd_account( irc_t *irc, char **cmd ) 216 216 { 217 217 account_t *a;
Note: See TracChangeset
for help on using the changeset viewer.