MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / updateMessages

Method updateMessages

src/database/WizDatabase.cpp:2280–2305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2278/* ---------------------------------------------------------------------- */
2279
2280bool WizDatabase::updateMessages(const CWizMessageDataArray& arrayMsg)
2281{
2282 // TODO: delete messages not exist on remote
2283 if (arrayMsg.empty())
2284 return false;
2285
2286 qint64 nVersion = -1;
2287
2288 bool bHasError = false;
2289 CWizMessageDataArray::const_iterator it;
2290 for (it = arrayMsg.begin(); it != arrayMsg.end(); it++)
2291 {
2292 const WIZMESSAGEDATA& msg = *it;
2293 if (!updateMessage(msg)) {
2294 bHasError = true;
2295 }
2296
2297 nVersion = qMax(nVersion, msg.nVersion);
2298 }
2299
2300 if (!bHasError) {
2301 setObjectVersion(WIZMESSAGEDATA::objectName(), nVersion);
2302 }
2303
2304 return !bHasError;
2305}
2306
2307bool WizDatabase::setAllBizInfoCore(const CWizBizDataArray& arrayBiz)
2308{

Callers 1

onGetMessagesMethod · 0.80

Calls 3

beginMethod · 0.80
endMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected