From 016299ce9bde2f4ab719ab9dce80b6fd46ce4c43 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Sat, 3 Nov 2001 08:23:37 +0000 Subject: [PATCH] Do not add addressmacros to addressbook --- docs/notework.txt | 3 +++ golded3/geusrbse.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/notework.txt b/docs/notework.txt index fdbed66..6cc7147 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,9 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +! GoldED+ will no longer add new entry to addressbook if it is an + addressmacro. + ! Updated uulib to the latest version. Few bugs fixed. Unordered UU encode now should be processed more accurately than with original library. diff --git a/golded3/geusrbse.cpp b/golded3/geusrbse.cpp index ce43316..d6fc083 100644 --- a/golded3/geusrbse.cpp +++ b/golded3/geusrbse.cpp @@ -777,6 +777,35 @@ void guserbase::update_addressbook(GMsg* msg, bool reverse, bool force) { if(nlname and strieql(nlname, name)) return; + // 9. It is an addressmacro + if(not CFG->addressmacro.empty()) { + std::vector::iterator n; + for(n=CFG->addressmacro.begin(); n != CFG->addressmacro.end(); n++) { + if(strieql(name, n->name) or strieql(n->name, iaddr)) + return; + if(iaddr[0] != NUL) { + INam buf, buf1, buf2; + char *ptr; + + if(n->name[0] == '@') { + strcpy(buf, n->name+1); + // UUCP/INTERNET addressing + ptr = strchr(buf, '/'); + if(ptr) { + *ptr++ = NUL; + if(strieql(name, buf)) + return; + } + } + else if(AA->isinternet()) { + ptr = n->name; + } + ParseInternetAddr(ptr, buf1, buf2); + if(strieql(iaddr, buf2) or strieql(name, buf1)) + return; + } + } + } } // Ok, let's add it...