summaryrefslogtreecommitdiff
path: root/plugins/Import/src/textjson.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-22 20:14:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-22 20:14:32 +0300
commit6b5eee23bee83dac706dcfcbc72e5cce3a89e4c8 (patch)
tree3761ebb717c407c48633b9bef0aef41824ad5687 /plugins/Import/src/textjson.cpp
parent635a81a5b4e12538d8aebf5eb85a632b08978f61 (diff)
if szModule is missing in an event, it should be filled from the contact's data
Diffstat (limited to 'plugins/Import/src/textjson.cpp')
-rw-r--r--plugins/Import/src/textjson.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp
index d17a87984b..de9a1755b1 100644
--- a/plugins/Import/src/textjson.cpp
+++ b/plugins/Import/src/textjson.cpp
@@ -42,7 +42,6 @@ class CDbxJson : public MDatabaseReadonly, public MZeroedObject
JSONNode *m_root = nullptr;
LIST<JSONNode> m_events;
LIST<char> m_modules;
- std::string m_proto;
public:
CDbxJson() :
@@ -82,8 +81,6 @@ public:
if ((m_root = json_parse(szFile)) == nullptr)
return EGROKPRF_DAMAGED;
- m_proto = (*m_root)["info"]["proto"].as_string();
-
for (auto &it : m_root->at("history"))
m_events.insert(&it);
@@ -150,14 +147,13 @@ public:
}
std::string szModule = (*node)["module"].as_string();
- if (!szModule.empty())
- szModule = m_proto;
-
- dbei->szModule = m_modules.find((char*)szModule.c_str());
- if (dbei->szModule == nullptr) {
- dbei->szModule = mir_strdup(szModule.c_str());
- m_modules.insert(dbei->szModule);
- }
+ if (!szModule.empty()) {
+ dbei->szModule = m_modules.find((char*)szModule.c_str());
+ if (dbei->szModule == nullptr) {
+ dbei->szModule = mir_strdup(szModule.c_str());
+ m_modules.insert(dbei->szModule);
+ }
+ }
std::string szBody = (*node)["body"].as_string();
if (!szBody.empty()) {