Fixed macro mechanism

This commit is contained in:
Alexander S. Aganichev
2000-12-27 12:45:20 +00:00
parent 748f2ea804
commit 3b938d46f3
4 changed files with 36 additions and 6 deletions

View File

@@ -266,7 +266,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
if(AA->isnet()) {
// 123456789012345678901234567
if(line->next and strneql(line->next->txt.c_str(), "-----BEGIN PGP MESSAGE-----", 27)) {
if(line->next and strneql(line->next->txt.c_str(), "-----BEGIN PGP ", 15)) {
line = AddKludge(line, "\001ENC: PGP");
}

View File

@@ -252,13 +252,23 @@ void CfgInit2() {
}
// ------------------------------------------------------------------
bool inline samekey(gkey key1, gkey key2) {
if(key1 > 0xff) // special key
return false;
return (tolower(key1) == key2) or (toupper(key1) == key2);
}
// ------------------------------------------------------------------
int IsMacro(gkey key, int type) {
vector<Macro>::iterator m = CFG->macro.begin();
while(m != CFG->macro.end()) {
if(((key == m->key) or (tolower(key) == m->key) or (toupper(key) == m->key)) and (type == m->type))
if(((key == m->key) or samekey(key, m->key)) and (type == m->type))
return true;
m++;
}
@@ -273,7 +283,7 @@ int PlayMacro(gkey key, int type) {
vector<Macro>::iterator m = CFG->macro.begin();
while(m != CFG->macro.end()) {
if(((key == m->key) or (tolower(key) == m->key) or (toupper(key) == m->key)) and (type == m->type)) {
if(((key == m->key) or samekey(key, m->key)) and (type == m->type)) {
RunMacro(m);
return true;
}