added: some work in Export plugin

changed: in base redirect we are using 301 moved permanently status code now (was 303)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@761 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-09-05 15:38:09 +00:00
parent 8c01b0f6c0
commit 392e8060ba
11 changed files with 230 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ namespace Export
const wchar_t plugin_name[] = L"export";
int mount_par_export_conf = -1;
ExportThread export_thread;
Message msg;
@@ -46,11 +46,33 @@ void FstabChanged(PluginInfo & info)
}
void InitPlugin(PluginInfo & info)
{
export_thread.SetUTF8(info.config->utf8);
info.system->thread_manager.Add(&export_thread);
}
void SendFile(PluginInfo & info)
{
Item & item = *reinterpret_cast<Item*>(info.p1);
const Item * item = reinterpret_cast<Item*>(info.p1);
log << log1 << "bedziemy wysylac strone o tytule: " << item.subject << ", url: " << item.url << logend;
if( !item )
return;
msg.type = WINIX_PL_EXPORT_TYPE_CREATE_FILE;
msg.url = info.config->url_proto;
msg.url += info.config->base_url;
info.system->dirs.MakePath(item->parent_id, msg.url, false);
msg.url += item->url;
msg.path.clear();
log << log1 << "Export: bede sciagal takiego swiniaka: " << msg.url << logend;
export_thread.AddMessage(msg);
}
@@ -75,6 +97,8 @@ using namespace Export;
plugin.Assign(WINIX_FILE_ADDED, SendFile);
plugin.Assign(WINIX_FILE_CHANGED, SendFile);
plugin.Assign(WINIX_PLUGIN_INIT, InitPlugin);
info.p1 = (void*)(plugin_name);
}