Improve backwards compatibility. (skip message was causing other rules to be ignored and forcing mails to end up in the inbox).

Have to be very careful changing this stuff, so easy to make a mistake.

svn path=/trunk/kdenetwork/kmail/; revision=48406
wilder-work
Don Sanders 26 years ago
parent 7fb83a0b01
commit c405f9e424
  1. 12
      kmfilteraction.cpp
  2. 8
      kmfiltermgr.cpp

@ -198,7 +198,7 @@ int KMFilterActionForward::process(KMMessage* aMsg, bool& /*stop*/)
debug("KMFilterActionForward: could not forward message (sending failed)");
return 1; // error: couldn't send
}
return 0;
return -1;
}
QWidget* KMFilterActionForward::createParamWidget(KMGFilterDlg* aParent)
@ -271,10 +271,10 @@ int KMFilterActionExec::process(KMMessage* /*aMsg*/, bool& /*stop*/)
rc = system(mCmd);
alarm(0);
signal(SIGALRM, oldSigHandler);
if (rc & 255) // sanders: I don't get this it seems to be the wrong way
return 0; // around to me.
if (rc & 255)
return 1;
else
return 1;
return -1;
}
QWidget* KMFilterActionExec::createParamWidget(KMGFilterDlg* aParent)
@ -331,7 +331,7 @@ KMFilterAction* KMFilterActionSkip::newAction(void)
int KMFilterActionSkip::process(KMMessage*, bool& stopIt)
{
stopIt = TRUE;
return 1;
return -1;
}
void KMFilterActionSkip::argsFromString(const QString)
@ -380,7 +380,7 @@ KMFilterActionIdentity::KMFilterActionIdentity(): KMFilterAction("set identity")
int KMFilterActionIdentity::process(KMMessage* msg, bool& )
{
msg->setHeaderField( "X-KMail-Identity", id );
return 0;
return -1;
}
QWidget* KMFilterActionIdentity::createParamWidget(KMGFilterDlg* aParent)

@ -84,15 +84,17 @@ int KMFilterMgr::process(KMMessage* msg)
if (!filter->matches(msg)) continue;
// debug("KMFilterMgr: filter %s matches message %s", filter->name().data(),
// msg->subject().data());
if (status < 0)
status = 0;
// if (status < 0)
// status = 0;
result = filter->execActions(msg, stopIt);
if (result == 2) { // Critical error
status = 2;
break;
}
else if (result == 1) // Small problem encountered, keep copy of message
else if (result == 1) // Message not saved
status = 1;
else if ((result == 0) && (status < 0)) // Message saved in a folder
status = 0;
}
if (status < 0) // No filters matched, keep copy of message

Loading…
Cancel
Save