diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-14 20:57:41 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-14 20:57:50 +0300 |
commit | b330cf1861cc79d629ad1a7ecb3161fe8210521b (patch) | |
tree | cc60bc42461f725b5209d5d47d33febb376dcb84 /plugins/NewStory/src/history_array.cpp | |
parent | b254b1118f3d1ed386b9ac39837ce045c1c02cc5 (diff) |
NewStory: first version that adds events to a Log
fixes #2298 (NewStory: отсутствует поддержка интерфейса для журналов)
Diffstat (limited to 'plugins/NewStory/src/history_array.cpp')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 96f79184c3..0a2304ea56 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -134,13 +134,17 @@ bool HistoryArray::addHistory(MCONTACT hContact, EventLoadMode) return true; } -bool HistoryArray::addEvent(MCONTACT hContact, MEVENT hEvent, EventLoadMode mode) +bool HistoryArray::addEvent(MCONTACT hContact, MEVENT hEvent, int count, EventLoadMode mode) { - allocateBlock(1); - tail->items[0].hContact = hContact; - tail->items[0].hEvent = hEvent; - if (mode != ELM_NOTHING) - tail->items[0].load(mode); + allocateBlock(count); + + for (int i = 0; i < count; i++) { + tail->items[i].hContact = hContact; + tail->items[i].hEvent = hEvent; + if (mode != ELM_NOTHING) + tail->items[i].load(mode); + hEvent = db_event_next(hContact, hEvent); + } return true; } |