quotient-im / libQuotient

A Qt library to write cross-platform clients for Matrix
https://quotient-im.github.io/libQuotient/
GNU Lesser General Public License v2.1
132 stars 56 forks source link

Add a promise/future pair to PendingEventItem #767

Closed KitsuneRal closed 1 month ago

KitsuneRal commented 2 months ago

PendingEventItem screams that it has semantics of a future even with its name - now one can obtain a future from it and do useful things in then(), instead of connecting to pendingEvent* signals. The downside - the future carries no information about the pending item index so it seems of limited use in event item models.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
72.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

KitsuneRal commented 2 months ago

@TobiasFella what do you think of switching to const PendingEventItem& or a Q_GADGET as a return value for all post*() calls, eventually or even for 0.9?

TobiasFella commented 2 months ago

@TobiasFella what do you think of switching to const PendingEventItem& or a Q_GADGET as a return value for all post*() calls, eventually or even for 0.9?

should be fine for us

TobiasFella commented 2 months ago

looks reasonable, will test later