-
Notifications
You must be signed in to change notification settings - Fork 11
Follow tombstone and predecessor history #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MadLittleMods
merged 31 commits into
main
from
madlittlemods/59-follow-tombstone-and-predecessor-history
Apr 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d5272e3
Draft: mostly test setup
MadLittleMods 359f95d
Draft: jumping to predecessor/successor
MadLittleMods 536512b
Merge branch 'main' into madlittlemods/59-follow-tombstone-and-predec…
MadLittleMods 7f98efa
Better log when event is missing from expected
MadLittleMods 63fac48
Add note on alternative place to start from
MadLittleMods d27b6c2
Add comment explaining what we're parsing here
MadLittleMods 0e21449
Crude working to jump backwards to predecessor in first test case
MadLittleMods 14f6e72
Fix m.room.create predecessor format
MadLittleMods 4549cc9
Slight refactor
MadLittleMods ed66667
Add note about assuming we are already joined
MadLittleMods 60b11dd
Re-usable URL converting utilities
MadLittleMods bd94901
Add test for same day
MadLittleMods 078fa0a
Change up tactic to display the given day of the predecessor room
MadLittleMods 54d7feb
Bail earlier
MadLittleMods f0bbc2b
Cleaner fetching
MadLittleMods b8a80fd
Working predecessor tests
MadLittleMods 17a045a
Fix jumping forward when there is a multiple day gap
MadLittleMods 0834f3f
Fix assertions in jump forward successor test
MadLittleMods c91a326
Fix predecessor not being picked up
MadLittleMods 4fd584d
Add more unconfirmed tests
MadLittleMods e9704a6
Revert back gap time so paginate out further as expected
MadLittleMods decb777
Fix jumping backwards when messages from the same hour
MadLittleMods 4d2a130
Add some tests that fail starting from larger precision
MadLittleMods 4a2bbcb
Try `ts` and doTimestampsStartFromSameUtcX(ts, tsForClosestEvent)
MadLittleMods 43bdc7d
Passing tests and maybe good logic
MadLittleMods a969b4d
Simplify and tests still pass
MadLittleMods 198a4b4
Add missing tests (all tests passing)
MadLittleMods d00cbfe
Remove `doTimestampsShareRoundedUpUtcX` utilities and rename `doTimes…
MadLittleMods 1d89487
Remove debug logging
MadLittleMods 81bc77a
Prefer tracking just by searching MSC3999 everywhere
MadLittleMods 9389bb2
Add comment thread reference for future reading
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
server/lib/matrix-utils/get-server-name-from-matrix-room-id-or-alias.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| 'use strict'; | ||
|
|
||
| const assert = require('assert'); | ||
|
|
||
| function getServerNameFromMatrixRoomIdOrAlias(roomIdOrAlias) { | ||
| assert(roomIdOrAlias); | ||
|
|
||
| const pieces = roomIdOrAlias.split(':'); | ||
| // We can only derive the server name if there is a colon in the string. Since room | ||
| // IDs are supposed to be treated as opaque strings, there is a future possibility | ||
| // that they will not contain a colon. | ||
| if (pieces.length < 2) { | ||
| return null; | ||
| } | ||
|
|
||
| const servername = pieces.slice(1).join(':'); | ||
|
|
||
| return servername; | ||
| } | ||
|
|
||
| module.exports = getServerNameFromMatrixRoomIdOrAlias; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.