summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_db.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-07-29 18:50:37 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-07-29 18:50:37 +0000
commit2afddc4305325447f91d879af7d5c4c280257867 (patch)
tree768293d3378dc33da532e22d9b99e19ca0323680 /protocols/SkypeWeb/src/skype_db.cpp
parent09f41999e99c45c0948d08f474682a85504a48df (diff)
SkypeWeb: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@14754 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_db.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_db.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp
index 478de25527..1d730d4296 100644
--- a/protocols/SkypeWeb/src/skype_db.cpp
+++ b/protocols/SkypeWeb/src/skype_db.cpp
@@ -84,34 +84,36 @@ MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char *
return hEvent;
}
JSONNode jEdit;
- jEdit.push_back(JSONNode("time", (long)edit_time));
- jEdit.push_back(JSONNode("text", szContent));
+ jEdit
+ << JSONNode("time", (long)edit_time)
+ << JSONNode("text", szContent);
- jEdits.push_back(jEdit);
+ jEdits << jEdit;
}
}
else
{
jMsg = JSONNode();
- JSONNode jOriginalMsg;
- JSONNode jEdits(JSON_ARRAY);
+ JSONNode jOriginalMsg; jOriginalMsg.set_name("original_message");
+ JSONNode jEdits(JSON_ARRAY); jEdits.set_name("edits");
JSONNode jEdit;
- jOriginalMsg.set_name("original_message");
- jOriginalMsg.push_back(JSONNode("time", (long)dbei.timestamp));
- jOriginalMsg.push_back(JSONNode("text", (char*)dbei.pBlob));
- jMsg.push_back(jOriginalMsg);
+ jOriginalMsg
+ << JSONNode("time", (long)dbei.timestamp)
+ << JSONNode("text", (char*)dbei.pBlob);
- jEdit.push_back(JSONNode("time", (long)edit_time));
- jEdit.push_back(JSONNode("text", szContent));
+ jMsg << jOriginalMsg;
- jEdits.push_back(jEdit);
- jEdits.set_name("edits");
- jMsg.push_back(jEdits);
+ jEdit
+ << JSONNode("time", (long)edit_time)
+ << JSONNode("text", szContent);
+
+ jEdits << jEdit;
+ jMsg << jEdits;
}
- int r = db_event_delete(hContact, hEvent);
+ db_event_delete(hContact, hEvent);
return AddDbEvent(SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE, hContact, dbei.timestamp, DBEF_UTF, jMsg.write().c_str(), szUid);
}