From 2afddc4305325447f91d879af7d5c4c280257867 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 29 Jul 2015 18:50:37 +0000 Subject: SkypeWeb: code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@14754 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_db.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_db.cpp') 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); } -- cgit v1.2.3