Commit graph

3625 commits

Author SHA1 Message Date
RMidhunSuresh
640a3fb9fa Check if contextEvent was found 2022-01-06 12:07:10 +05:30
RMidhunSuresh
05d2defa2d Rename fetchedEntries --> contextEntriesNotInTimeline 2022-01-06 12:07:10 +05:30
RMidhunSuresh
c3bef6d4d2 Rename dependents --> contextForEntries 2022-01-06 12:07:10 +05:30
RMidhunSuresh
d1818d2a57 Reuse code in getOrLoadEntry 2022-01-06 12:07:10 +05:30
RMidhunSuresh
f5fadf700e Move event to remoteEntries if needed 2022-01-06 12:07:10 +05:30
RMidhunSuresh
d924dbb723 Add explaining comment 2022-01-06 12:07:10 +05:30
RMidhunSuresh
544dca3b18 Use _updateEntry 2022-01-06 12:07:10 +05:30
RMidhunSuresh
39f68e8c2f Refactor out magic string 2022-01-06 12:07:10 +05:30
RMidhunSuresh
5c0bbdd4c8 Move methods into Timeline 2022-01-06 12:07:10 +05:30
RMidhunSuresh
51b7b21082 Implement readById() in TimelineReader 2022-01-06 12:07:10 +05:30
RMidhunSuresh
0da94e51e0 Use map and fetch from Map if available 2022-01-06 12:07:10 +05:30
RMidhunSuresh
4a6293dcdc Made code more readable 2022-01-06 12:07:10 +05:30
RMidhunSuresh
287212956b findAndUpdate instead of update 2022-01-06 12:07:10 +05:30
RMidhunSuresh
7a91dd9595 Improve comment 2022-01-06 12:07:10 +05:30
RMidhunSuresh
4a81e06e96 Track fetched entries for redactions 2022-01-06 12:07:10 +05:30
RMidhunSuresh
ea89c272b9 Support redaction changes in remoteEntries 2022-01-06 12:07:10 +05:30
RMidhunSuresh
c690de9f7b Support decryption on entries fetched from hs 2022-01-06 12:07:10 +05:30
RMidhunSuresh
7cc3d4b91a Emit updated entries 2022-01-06 12:07:10 +05:30
RMidhunSuresh
053dcf39a5 Use NonPersistedEventEntry 2022-01-06 12:07:10 +05:30
RMidhunSuresh
d191b327c6 Change comment 2022-01-06 12:07:10 +05:30
RMidhunSuresh
06864a65b7 Add contextEventId 2022-01-06 12:07:10 +05:30
RMidhunSuresh
764e38f8c9 Use 'context' instead of 'related' 2022-01-06 12:07:10 +05:30
RMidhunSuresh
696980aca4 Parse display name and avatar of event 2022-01-06 12:07:10 +05:30
RMidhunSuresh
0c42f53a2f Implement context endpoint 2022-01-06 12:07:06 +05:30
RMidhunSuresh
e901142661 await on loading related events 2022-01-06 11:59:58 +05:30
RMidhunSuresh
2265d198a6 Formatting fix 2022-01-06 11:59:58 +05:30
RMidhunSuresh
b753507b8d WIP 2022-01-06 11:59:58 +05:30
Bruno Windels
196e3726cb
Merge pull request #630 from vector-im/bwindels/otk-count-cleanup
Missing OTK count in sync doesn't mean 0, but rather no change
2022-01-05 14:29:51 +01:00
Bruno Windels
c9d11d6f19 missing otk count does not mean 0 but rather no change 2022-01-05 14:26:15 +01:00
Bruno Windels
aabfbf507e typo in comments 2022-01-05 14:25:42 +01:00
Bruno Windels
908f9a7ce3 try to export stylesheet 2021-12-22 18:04:30 +01:00
Bruno Windels
203a5fd88c
Merge pull request #622 from vector-im/bwindels/sdk-refactoring
Some API cleanup ahead of first SDK release
2021-12-22 17:58:20 +01:00
Bruno Windels
13e77636a9 export paths from vite.js as required by Platform, reorder ctor params
make it easier for SDK users
2021-12-22 17:48:08 +01:00
Bruno Windels
6247ced7b7 dont export, the ctor of these classes is not a public API 2021-12-22 17:24:58 +01:00
Bruno Windels
ba27d20b24 only pass platform into Client
simplifying the API for SDK
2021-12-22 17:20:37 +01:00
Bruno Windels
9238961992 cache olm and olm worker promise inside Platform
as prep to call them every time a Client is created
2021-12-22 17:19:10 +01:00
Bruno Windels
fe26f48c47 rename SessionContainer to Client 2021-12-22 17:09:52 +01:00
Bruno Windels
b5fe65d0cc
Merge pull request #617 from vector-im/bwindels/sdk-build
SDK build
2021-12-22 16:54:03 +01:00
Bruno Windels
24afe1e496 add licenses to readme of things we actually bundle
rather than just depend on
2021-12-22 16:45:08 +01:00
Bruno Windels
5f389e654a add description 2021-12-22 16:37:53 +01:00
Bruno Windels
c31215bc2a less logging during build 2021-12-22 16:31:19 +01:00
Bruno Windels
c3ff571af7 update SDK doc, use it as sdk package readme 2021-12-22 16:31:19 +01:00
Bruno Windels
441fa13bfd change sdk package name to hydrogen-view-sdk
as we might want to also have a lower level sdk later on
2021-12-22 16:31:19 +01:00
Bruno Windels
3bee4b4585 bundle bs58 to avoid pain of bundle transitive dependency for lib users
bs58 depends on safe-buffer, which depends on buffer, which is a bit
of a pain to bundle as it is a built-in node module. You'd typically
replace buffer with a browser polyfill in your build system but:
 a) this is somewhat a pain to setup for simple apps
 b) the polyfill is way more than we need (6kb), so we prefer to bundle
    our minimal buffer replacement that uses Uint8Array. Since it is
    a transitive dependency, we need to bundle bs58 and all of its
    transitive dependencies (2.5kb) as well, so if users of hydrogen-sdk
    also use any of these, they'll be double included in their bundle.
2021-12-22 16:31:19 +01:00
Bruno Windels
b48280905e include path/vite in sdk bundle 2021-12-22 16:31:19 +01:00
Bruno Windels
163dae647b move output of both lib and asset build around for coherent package 2021-12-22 16:31:19 +01:00
Bruno Windels
c921091957 run two vite builds for the sdk build, assets & js separately 2021-12-22 16:31:19 +01:00
Bruno Windels
6add3f1da3 WIP 2021-12-22 16:31:19 +01:00
Bruno Windels
ceb0b5793b somewhat works, but not everything we need
it's missing still:
 - non-css assets like the download sandbox and the olm worker aren't written for some reason
 - the es and cjs lib.js entry points end up in assets with a hash for some reason
 - in these entry files, apart from our exports, something is adding an import statement for every import that was found in the tree
 - all assets are hashed even though the config tries to disable that
 - tests are included
2021-12-22 16:31:18 +01:00
Bruno Windels
14b854ad4f make tsconfig file to build declaration files 2021-12-22 16:31:18 +01:00