Page MenuHomePhorge

Add draftRel for room
Needs RevisionPublic

Authored by nannanko on Wed, Mar 25, 9:25 AM.

Details

Reviewers
tusooa
Group Reviewers
O1: the Kazv Project
Summary

Sometimes certain events occupy the chat box, this diff makes the room remember this status as well as the old draft so that it can be restored when the time is right.

This will cause kazv don't works with old sessions.

Type: add

Test Plan

Verify unit tests passed.

Diff Detail

Repository
rL libkazv
Branch
nannanko/restore-draft
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 582
Build 1146: Invoke BuildbotBuildbot build #1460
Build 1145: arc lint + arc unit

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Wed, Mar 25, 9:37 AM
Harbormaster failed remote builds in B582: Diff 898!
nannanko edited the summary of this revision. (Show Details)

buildbot is broken

tusooa requested changes to this revision.Fri, Mar 27, 9:41 AM
tusooa added inline comments.
src/client/room/room-model.hpp
266–270

I think it will be good to put this into its own type:

struct LocalDraft
{
    std::string text;
    std::string relType;
    std::string relatedEventId;
};

Then, instead of using a simple string of oldDraft, we can store all draft versions in a immer::flex_vector<LocalDraft>.

When the user clicks Reply or Edit, push a LocalDraft into the vector. When the user clicks Close and confirms, pop the last object from the vector. The current draft can be obtained by the last element from the vector (or a default-initialized LocalDraft when the vector is empty).

SaveLocalDraftAction will be changed to only modify the current draft.

This revision now requires changes to proceed.Fri, Mar 27, 9:41 AM