diff options
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; } |