Skip to content
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

quick and dirty /join command #3288

Merged
merged 8 commits into from
Sep 19, 2024
Merged

quick and dirty /join command #3288

merged 8 commits into from
Sep 19, 2024

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Sep 17, 2024

In order to avoid getting crucified by the matrix community for shipping a matrix client which can't join rooms by alias (somewhat like shipping a web browser without a url bar), here's a quick go at adding a /join slash command as an easter-egg for powerusers.

I've probably done it wrong, but:

  • The slashcommand code is on the TimelineViewModel for now, alongside the logic which turns composer input into sending messages.
  • In order to actually open the room which you then join, it uses openURL - but it has to use the one inside the SwiftUI environment given that's where the local app routing happens (otherwise it goes and opens it in an external app). So I pull an openURL handler in a closure through in the state bindings from the TimelineView to the TimelineViewModel. I assume there may be a fancier way to get SwiftUI to handle the openURL, but this seems to work fine even if it's a bit ugly. (How come AppMediator has a useless open() method which doesn't use the App's openURL impl?)

Pull Request Checklist

@ara4n ara4n added the pr-feature for a new feature label Sep 17, 2024
@ara4n ara4n requested a review from a team as a code owner September 17, 2024 01:42
@ara4n ara4n requested review from Velin92 and removed request for a team September 17, 2024 01:42
Copy link

github-actions bot commented Sep 17, 2024

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ Please add a sign-off to either the PR description or to the commits themselves.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 9fdf1f2

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 18.75000% with 26 lines in your changes missing coverage. Please review.

Project coverage is 77.34%. Comparing base (943f33b) to head (9fdf1f2).
Report is 1 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...X/Sources/Screens/Timeline/TimelineViewModel.swift 7.14% 26 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3288      +/-   ##
===========================================
- Coverage    77.37%   77.34%   -0.03%     
===========================================
  Files          735      735              
  Lines        59446    59475      +29     
===========================================
+ Hits         45995    46001       +6     
- Misses       13451    13474      +23     
Flag Coverage Δ
unittests 68.68% <18.75%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link

sonarcloud bot commented Sep 19, 2024

@Velin92 Velin92 enabled auto-merge (squash) September 19, 2024 14:24
@Velin92 Velin92 merged commit 78fb64c into develop Sep 19, 2024
7 checks passed
@Velin92 Velin92 deleted the matthew/join branch September 19, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants