MCPcopy Create free account
hub / github.com/BlueMatthew/WechatExporter / parseFile

Method parseFile

WechatExporter/core/MessageParser.cpp:1168–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166}
1167
1168void MessageParser::parseFile(const std::string& sessionPath, const std::string& sessionAssertsPath, const std::string& src, const std::string& dest, const std::string& fileName, TemplateValues& tv) const
1169{
1170 bool hasFile = false;
1171 if ((m_options & SPO_IGNORE_FILE) == 0)
1172 {
1173 hasFile = m_iTunesDb.copyFile(src, combinePath(sessionPath, sessionAssertsPath), dest);
1174 }
1175
1176 if (hasFile)
1177 {
1178 tv.setName("plainshare");
1179 tv["%%SHARINGURL%%"] = sessionAssertsPath + "/" + dest;
1180 tv["%%SHARINGTITLE%%"] = fileName;
1181 tv["%%MESSAGE%%"] = "";
1182 tv["%%MSGTYPE%%"] = "file";
1183 }
1184 else
1185 {
1186 tv.setName("msg");
1187 tv["%%MESSAGE%%"] = formatString(getLocaleString("[File: %s]"), fileName.c_str());
1188 }
1189}
1190
1191void MessageParser::parseCard(const Session& session, const std::string& sessionPath, const std::string& portraitDir, const std::string& cardMessage, TemplateValues& tv) const
1192{

Callers

nothing calls this directly

Calls 4

combinePathFunction · 0.85
formatStringFunction · 0.85
setNameMethod · 0.80
copyFileMethod · 0.45

Tested by

no test coverage detected