added: winix uses now [filter] statement from ezc
added: notifications to threads (were temporarily disabled) changed: templates in notifications git-svn-id: svn://ttmath.org/publicrep/winix/trunk@712 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -50,6 +50,18 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
void CreateThread::SendNotify(const Item & item)
|
||||
{
|
||||
// sending notification
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_ADD;
|
||||
notify_msg.template_index = thread_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
notify_msg.item_link = notify_msg.dir_link;
|
||||
notify_msg.item_link += item.url;
|
||||
|
||||
system->notify.ItemChanged(notify_msg);
|
||||
}
|
||||
|
||||
|
||||
void CreateThread::MakePost()
|
||||
@@ -77,6 +89,7 @@ void CreateThread::MakePost()
|
||||
{
|
||||
log << log2 << "CreateThread: added a new thread" << logend;
|
||||
system->RedirectTo(cur->request->item);
|
||||
SendNotify(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "functions/functionbase.h"
|
||||
#include "tdb.h"
|
||||
#include "threadinfo.h"
|
||||
#include "notify/notify.h"
|
||||
|
||||
|
||||
namespace Thread
|
||||
@@ -35,7 +36,9 @@ private:
|
||||
TDb * tdb;
|
||||
ThreadInfo * thread_info;
|
||||
Thread thread;
|
||||
NotifyMsg notify_msg;
|
||||
|
||||
void SendNotify(const Item & item);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,19 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
void Reply::SendNotify(const Item & item)
|
||||
{
|
||||
// sending notification
|
||||
notify_msg.code = WINIX_NOTIFY_CODE_REPLY;
|
||||
notify_msg.template_index = thread_info->template_index;
|
||||
notify_msg.dir_link = config->base_url;
|
||||
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
|
||||
notify_msg.item_link = notify_msg.dir_link;
|
||||
notify_msg.item_link += item.url;
|
||||
|
||||
system->notify.ItemChanged(notify_msg);
|
||||
}
|
||||
|
||||
|
||||
void Reply::MakePost()
|
||||
{
|
||||
@@ -93,6 +106,7 @@ void Reply::MakePost()
|
||||
{
|
||||
log << log2 << "Reply: added an answer in a thread" << logend;
|
||||
system->RedirectTo(cur->request->item);
|
||||
SendNotify(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "functions/functionbase.h"
|
||||
#include "tdb.h"
|
||||
#include "threadinfo.h"
|
||||
#include "notify/notify.h"
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +40,9 @@ private:
|
||||
Item answer;
|
||||
Thread thread;
|
||||
Item * files_dir;
|
||||
NotifyMsg notify_msg;
|
||||
|
||||
void SendNotify(const Item & item);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user