Session History¶
This document describes how session history is loaded, displayed, and trimmed.
Overview¶
- Session history is represented as asset records (text, face, photo, voice, video).
HistoryListWidgetreceives history items from engine callbacks and creates an asset widget per record.- Widgets are inserted in creation-time order so the list remains chronological.
Loading Flow¶
HistoryListWidget::setGroupieIdclears current UI list and callsfromGuiQuerySessionHistory.- Engine callbacks deliver matching assets through
toGuiAssetSessionHistory. - A concrete widget type is created based on asset type.
- Widget type used can be
AssetTextWidget,AssetFaceWidget,AssetPhotoWidget,AssetVoiceWidget, orAssetVideoWidget.
Add To Library (Media)¶
- Media widgets expose a library button through avatar bars.
- Clicking that button emits
signalAddLibraryAsset(AssetBaseWidget*). HistoryListWidget::slotAddAssetToLibraryvalidates the asset is a file/media asset.HistoryListWidget::slotAddAssetToLibrarycallsP2PEngine::fromGuiSetFileIsInLibrary(fileInfo, true).HistoryListWidget::slotAddAssetToLibrarymarks local asset state as in-library.HistoryListWidget::slotAddAssetToLibraryhides the library button for that widget.
Max Message History Pruning¶
HistoryListWidgetenforcesVxGetMaxMessageHistory()after adding each new history item.- If item count exceeds max, oldest items are removed first.
Prune behavior for each removed item:
- Non-file assets are removed from asset manager (
eAssetActionRemoveFromAssetMgr). - File/media assets in Library are removed from asset manager only (
eAssetActionRemoveFromAssetMgr). - File/media assets not in Library are shredded/deleted (
eAssetActionShreadFile).
This prevents orphaned media accumulation while preserving user-kept media in Library.