From 38f9de8573985ee98df623ff4082c041b1e82d16 Mon Sep 17 00:00:00 2001 From: xidui <664984593@qq.com> Date: Thu, 2 Jun 2016 03:04:13 +0800 Subject: [PATCH 1/3] add q2a forum exporter --- write-my-own-exporter.md | 1 + 1 file changed, 1 insertion(+) diff --git a/write-my-own-exporter.md b/write-my-own-exporter.md index 7d818c9..121482f 100644 --- a/write-my-own-exporter.md +++ b/write-my-own-exporter.md @@ -5,6 +5,7 @@ * https://github.com/psychobunny/nodebb-plugin-import-phpbb * https://github.com/akhoury/nodebb-plugin-import-ipboard * https://github.com/akhoury/nodebb-plugin-import-punbb +* https://github.com/xidui/nodebb-plugin-import-q2a ## Terminology From 24906bb796c2102809eb7f28ca30fb3fa754e1ce Mon Sep 17 00:00:00 2001 From: xidui <664984593@qq.com> Date: Fri, 3 Jun 2016 00:01:35 +0800 Subject: [PATCH 2/3] add q2a exporter to plugin.json --- plugin.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index a3465d8..8c11f91 100644 --- a/plugin.json +++ b/plugin.json @@ -30,7 +30,8 @@ "nodebb-plugin-import-wordpress": "*", "nodebb-plugin-import-jforum": "*", "nodebb-plugin-import-esotalk": "*", - "nodebb-plugin-import-esotalk2": "*" + "nodebb-plugin-import-esotalk2": "*", + "nodebb-plugin-import-q2a": "*" }, "templates": "./public/templates" } From 69f6ad8d65f50fb279e64dce46ed7723af999959 Mon Sep 17 00:00:00 2001 From: xidui <664984593@qq.com> Date: Fri, 10 Jun 2016 03:05:26 +0800 Subject: [PATCH 3/3] add _email support for vote --- server/importer.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/server/importer.js b/server/importer.js index 9703eeb..9ddf117 100644 --- a/server/importer.js +++ b/server/importer.js @@ -2202,12 +2202,26 @@ var async = require('async'), }); }, function(cb) { - Data.getImportedUser(vote._uid, function(err, user) { - if (err) { - Importer.warn('getImportedUser: ' + vote._uid + ' err: ' + err); - } - cb(null, user); - }); + if (vote._uemail) { + User.getUidByEmail(vote._uemail, function(err, uid) { + if (err || !uid) { + return cb(null, null); + } + User.getUserData(uid, function(err, data) { + if (err || !uid) { + return cb(null, null); + } + cb(null, data); + }); + }); + } else { + Data.getImportedUser(vote._uid, function (err, user) { + if (err) { + Importer.warn('getImportedUser: ' + vote._uid + ' err: ' + err); + } + cb(null, user); + }); + } } ], function(err, results){