Changeset eabe6d4
- Timestamp:
- 2015-01-16T19:50:24Z (10 years ago)
- Branches:
- master
- Children:
- 885d294
- Parents:
- 6b13103
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
r6b13103 reabe6d4 1117 1117 void cmd_otr_keygen(irc_t *irc, char **args) 1118 1118 { 1119 int i, n;1120 1119 account_t *a; 1121 1120 1122 n = atoi(args[1]); 1123 if(n<0 || (!n && strcmp(args[1], "0"))) { 1124 irc_rootmsg(irc, "%s: invalid account number", args[1]); 1121 if ((a = account_get(irc->b, args[1])) == NULL) { 1122 irc_rootmsg(irc, "Could not find account `%s'.", args[1]); 1125 1123 return; 1126 1124 } 1127 1125 1128 a = irc->b->accounts; 1129 for(i=0; i<n && a; i++, a=a->next); 1130 if(!a) { 1131 irc_rootmsg(irc, "%s: no such account", args[1]); 1126 if(keygen_in_progress(irc, a->user, a->prpl->name)) { 1127 irc_rootmsg(irc, "keygen for account `%s' already in progress", a->tag); 1132 1128 return; 1133 1129 } 1134 1130 1135 if(keygen_in_progress(irc, a->user, a->prpl->name)) {1136 irc_rootmsg(irc, "keygen for account %d already in progress", n);1137 return;1138 }1139 1140 1131 if(otrl_privkey_find(irc->otr->us, a->user, a->prpl->name)) { 1141 char *s = g_strdup_printf("account %d already has a key, replace it?", n);1132 char *s = g_strdup_printf("account `%s' already has a key, replace it?", a->tag); 1142 1133 query_add(irc, NULL, s, yes_keygen, NULL, NULL, a); 1143 1134 g_free(s);
Note: See TracChangeset
for help on using the changeset viewer.