New feature: AKAMATCHFROMTO

This commit is contained in:
Stas Degteff 2005-09-19 18:05:35 +00:00
parent 5d0bf484fc
commit eb75fd337c
2 changed files with 12 additions and 3 deletions

View File

@ -874,6 +874,10 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
// ... but only if we did NOT change aka manually
if(AA->Aka().addr.equals(AA->aka())) {
Addr aka_addr = AA->Aka().addr;
if (CFG->akamatchfromto)
aka_addr = omsg->dest;
else
aka_addr = AA->Aka().addr;
AkaMatch(&aka_addr, &omsg->orig);
AA->SetAka(aka_addr);
}

View File

@ -67,7 +67,7 @@ bool edit_pathname(char* buf, int buf_size, char* title, int helpcat) {
if(not edit_string(buf, buf_size, title, helpcat))
return false;
std::vector<FileAlias>::iterator z;
for(z = CFG->filealias.begin(); z != CFG->filealias.end(); z++) {
if(strieql(buf, z->alias)) {
@ -119,7 +119,7 @@ bool PopupLocked(long tries, int isopen, const char* file) {
usleep(1000);
#else
sleep(1);
#endif
#endif
// Try again
return true;
}
@ -214,7 +214,12 @@ int AkaMatch(ftn_addr* match, const ftn_addr* addr) {
for(a = CFG->aka.begin(), aka = 0; a != CFG->aka.end(); aka++, a++) {
if(match->equals(a->addr))
matchaka = aka;
{
if (CFG->akamatchfromto)
return aka;
else
matchaka = aka;
}
// Ignore fakenet addresses
if(a->addr.net != a->pointnet) {