diff --git a/core/misc.cpp b/core/misc.cpp index ee30025..c0ff04b 100755 --- a/core/misc.cpp +++ b/core/misc.cpp @@ -952,3 +952,62 @@ static std::string ain; UrlEncode(ain, out, clear_out); } + + + +void QEncodeAddChar(wchar_t c, std::string & out) +{ + if( (c>='A' && c<='Z') || + (c>='a' && c<='z') || + (c>='0' && c<='9') ) + { + out += char(c); + } + else + { + char buf1[10]; + char buf2[10]; + + size_t len1 = sizeof(buf1) / sizeof(char); + size_t len2 = sizeof(buf2) / sizeof(char); + size_t len = Ezc::IntToUTF8(int(c), buf1, len1); + + for(size_t i=0 ; i ezc_functions; NotifyUserMsg notify_user_msg; NotifyMsg notify_msg; - +// name in qencoding +static std::string name_q; void notify_file_added(Info & i) @@ -71,19 +73,17 @@ void notify_thread_post_changed(Info & i) -void notify_to(Info & i) +void notify_to_email(Info & i) { i.out << notify_user_msg.email; } - -/* -void notify_doc_base_url(Info & i) +void notify_to_name(Info & i) { - i.out << notify_user_msg.doc_base_url; + QEncode(notify_user_msg.name, name_q); + i.out << name_q; } -*/ void notify_item_link(Info & i) @@ -98,6 +98,8 @@ void notify_dir_link(Info & i) } + + void CreateFunctions() { ezc_functions.Clear(); @@ -111,8 +113,8 @@ void CreateFunctions() ezc_functions.Insert("notify_thread_replayed", notify_thread_replayed); ezc_functions.Insert("notify_thread_post_changed", notify_thread_post_changed); - ezc_functions.Insert("notify_to", notify_to); - //ezc_functions.Insert("notify_doc_base_url", notify_doc_base_url); + ezc_functions.Insert("notify_to_email", notify_to_email); + ezc_functions.Insert("notify_to_name", notify_to_name); ezc_functions.Insert("notify_item_link", notify_item_link); ezc_functions.Insert("notify_dir_link", notify_dir_link); diff --git a/txt/notify_email_cms.txt b/txt/notify_email_cms.txt index be06fd9..5aa0e47 100755 --- a/txt/notify_email_cms.txt +++ b/txt/notify_email_cms.txt @@ -1,6 +1,6 @@ Subject: [if notify_file_added]{notify_new}[else]{notify_change}[end]\n From: {notify_from}\n -To: [notify_to]\n +To: [notify_to_name] <[notify_to_email]>\n Content-Type: {notify_content_type} \n\n {notify_header} diff --git a/txt/notify_email_thread.txt b/txt/notify_email_thread.txt index 27cdc0e..8ab7e5f 100755 --- a/txt/notify_email_thread.txt +++ b/txt/notify_email_thread.txt @@ -1,6 +1,6 @@ Subject: [if notify_thread_added]{notify_new}[else]{notify_change}[end]\n From: {notify_from}\n -To: [notify_to]\n +To: [notify_to_name] <[notify_to_email]>\n Content-Type: {notify_content_type} \n\n {notify_header} diff --git a/txt/notify_email_ticket.txt b/txt/notify_email_ticket.txt index ceddc1d..46bbefa 100755 --- a/txt/notify_email_ticket.txt +++ b/txt/notify_email_ticket.txt @@ -1,6 +1,6 @@ Subject: {notify_new}\n From: {notify_from}\n -To: [notify_to]\n +To: [notify_to_name] <[notify_to_email]>\n Content-Type: {notify_content_type} \n\n {notify_header}