Changeset a13855a
- Timestamp:
- 2008-02-06T16:42:23Z (17 years ago)
- Branches:
- master
- Children:
- 5a71d9c
- Parents:
- 3c80a9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
r3c80a9d ra13855a 43 43 void op_log_message(void *opdata, const char *message); 44 44 45 /* TODO: int op_max_message_size(void *opdata, ConnContext *context); */ 46 47 /* TODO: const char *op_account_name(void *opdata, const char *account, 48 const char *protocol); */ 45 int op_max_message_size(void *opdata, ConnContext *context); 46 47 const char *op_account_name(void *opdata, const char *account, const char *protocol); 49 48 50 49 … … 132 131 global.otr_ops.still_secure = &op_still_secure; 133 132 global.otr_ops.log_message = &op_log_message; 134 global.otr_ops.max_message_size = NULL;135 global.otr_ops.account_name = NULL;133 global.otr_ops.max_message_size = &op_max_message_size; 134 global.otr_ops.account_name = &op_account_name; 136 135 global.otr_ops.account_name_free = NULL; 137 136 } … … 221 220 { 222 221 irc_t *irc = a->irc; 223 char buf[45]; 224 char *fp; 225 226 fp = otrl_privkey_fingerprint(irc->otr_us, buf, a->user, a->prpl->name); 227 if(fp) { 228 irc_usermsg(irc, "otr: %s/%s ready with f'print %s", 229 a->user, a->prpl->name, fp); 222 OtrlPrivKey *k; 223 224 k = otrl_privkey_find(irc->otr_us, a->user, a->prpl->name); 225 if(k) { 226 irc_usermsg(irc, "otr: %s/%s ready", 227 a->user, a->prpl->name); 230 228 } else { 231 229 otr_keygen(irc, a->user, a->prpl->name); … … 242 240 if(!g_mutex_trylock(ic->irc->otr_mutex)) { 243 241 /* TODO: queue msgs received during keygen for later */ 244 irc_usermsg(ic->irc, "msg from %s /%sduring keygen - dropped",245 handle, ic->acc->prpl->name);242 irc_usermsg(ic->irc, "msg from %s during keygen - dropped", 243 peernick(ic->irc, handle, ic->acc->prpl->name)); 246 244 return NULL; 247 245 } … … 290 288 291 289 if(!g_mutex_trylock(ic->irc->otr_mutex)) { 292 irc_usermsg(ic->irc, "msg to %s /%sduring keygen - not sent",293 handle, ic->acc->prpl->name);290 irc_usermsg(ic->irc, "msg to %s during keygen - not sent", 291 peernick(ic->irc, handle, ic->acc->prpl->name)); 294 292 return 1; 295 293 } … … 487 485 { 488 486 log_message(LOGLVL_INFO, "%s", message); 487 } 488 489 int op_max_message_size(void *opdata, ConnContext *context) 490 { 491 /* TODO: make max_message_size a property of the prpl. 492 the values here are taken from the libotr UPGRADING file */ 493 if(!strcmp(context->protocol, "msn")) 494 return 1409; 495 if(!strcmp(context->protocol, "yahoo")) 496 return 832; 497 if(!strcmp(context->protocol, "oscar")) 498 return 2343; 499 } 500 501 const char *op_account_name(void *opdata, const char *account, const char *protocol) 502 { 503 struct im_connection *ic = (struct im_connection *)opdata; 504 505 log_message(LOGLVL_DEBUG, "op_account_name '%s' '%s'", account, protocol); 506 507 return peernick(ic->irc, account, protocol); 489 508 } 490 509 … … 947 966 account_t *acc = (account_t *)data; 948 967 968 /* TODO: remember that we didn't want a key? */ 949 969 irc_usermsg(acc->irc, "proceeding without key, otr inoperable on %s/%s", 950 970 acc->user, acc->prpl->name);
Note: See TracChangeset
for help on using the changeset viewer.