mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
Merge branch 'master' of https://github.com/vector-im/element-ios into feature/3269_merge_element_1_8_18
# Conflicts: # Config/AppIdentifiers.xcconfig # Config/AppVersion.xcconfig # Podfile # Podfile.lock # Riot/Assets/de.lproj/Vector.strings # Riot/Generated/Images.swift # Riot/Modules/Analytics/DecryptionFailureTracker.m # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Onboarding/OnboardingCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/RoomViewController.m # Riot/SupportingFiles/Info.plist # Riot/Utils/EventFormatter.m # Riot/Utils/Tools.h # Riot/Utils/Tools.m # Riot/target.yml # RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift # fastlane/Fastfile # project.yml
This commit is contained in:
@@ -16,10 +16,12 @@
|
||||
*/
|
||||
|
||||
#import "MXKAuthenticationRecaptchaWebView.h"
|
||||
#import "ThemeService.h"
|
||||
|
||||
NSString *kMXKRecaptchaHTMLString = @"<html> \
|
||||
<head> \
|
||||
<meta name='viewport' content='initial-scale=1.0' /> \
|
||||
<style>@media (prefers-color-scheme: dark) { body { background-color: #15191E; } }</style> \
|
||||
<script type=\"text/javascript\"> \
|
||||
var verifyCallback = function(response) { \
|
||||
/* Generic method to make a bridge between JS and the WKWebView*/ \
|
||||
@@ -33,7 +35,8 @@ var verifyCallback = function(response) { \
|
||||
var onloadCallback = function() { \
|
||||
grecaptcha.render('recaptcha_widget', { \
|
||||
'sitekey' : '%@', \
|
||||
'callback': verifyCallback \
|
||||
'callback': verifyCallback, \
|
||||
'theme': '%@' \
|
||||
}); \
|
||||
}; \
|
||||
</script> \
|
||||
@@ -78,7 +81,9 @@ var onloadCallback = function() { \
|
||||
[self addSubview:activityIndicator];
|
||||
[activityIndicator startAnimating];
|
||||
|
||||
NSString *htmlString = [NSString stringWithFormat:kMXKRecaptchaHTMLString, siteKey];
|
||||
NSString *theme = ThemeService.shared.isCurrentThemeDark ? @"dark" : @"light";
|
||||
|
||||
NSString *htmlString = [NSString stringWithFormat:kMXKRecaptchaHTMLString, siteKey, theme];
|
||||
|
||||
[self loadHTMLString:htmlString baseURL:[NSURL URLWithString:homeServer]];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// The last hit test location received by the view.
|
||||
@property (nonatomic, readonly) CGPoint lastHitTestLocation;
|
||||
|
||||
|
||||
/// Register a view that has been added as a pill to this text view.
|
||||
/// This is needed in order to flush pills that are not always removed properly by the system.
|
||||
/// All registered views will be manually removed from hierarchy on attributedText or text updates.
|
||||
///
|
||||
/// @param pillView pill view to register
|
||||
- (void)registerPillView:(UIView *)pillView API_AVAILABLE(ios(15));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
*/
|
||||
|
||||
#import "MXKMessageTextView.h"
|
||||
#import "UITextView+MatrixKit.h"
|
||||
#import "GeneratedInterface-Swift.h"
|
||||
|
||||
@interface MXKMessageTextView()
|
||||
|
||||
@property (nonatomic, readwrite) CGPoint lastHitTestLocation;
|
||||
@property (nonatomic) NSHashTable *pillViews;
|
||||
|
||||
@end
|
||||
|
||||
@@ -51,7 +52,41 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [self isThereALinkNearPoint:point];
|
||||
return [self isThereALinkNearLocation:point];
|
||||
}
|
||||
|
||||
#pragma mark - Pills Flushing
|
||||
|
||||
- (void)setText:(NSString *)text
|
||||
{
|
||||
if (@available(iOS 15.0, *)) {
|
||||
[self flushPills];
|
||||
}
|
||||
[super setText:text];
|
||||
}
|
||||
|
||||
- (void)setAttributedText:(NSAttributedString *)attributedText
|
||||
{
|
||||
if (@available(iOS 15.0, *)) {
|
||||
[self flushPills];
|
||||
}
|
||||
[super setAttributedText:attributedText];
|
||||
}
|
||||
|
||||
- (void)registerPillView:(UIView *)pillView
|
||||
{
|
||||
[self.pillViews addObject:pillView];
|
||||
}
|
||||
|
||||
/// Flushes all previously registered Pills from their hierarchy.
|
||||
- (void)flushPills API_AVAILABLE(ios(15))
|
||||
{
|
||||
for (UIView* view in self.pillViews)
|
||||
{
|
||||
view.alpha = 0.0;
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
self.pillViews = [NSHashTable weakObjectsHashTable];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -269,6 +269,11 @@ typedef enum : NSUInteger
|
||||
*/
|
||||
- (IBAction)onTouchUpInside:(UIButton*)button;
|
||||
|
||||
/**
|
||||
Send message currently displayed inside toolbar's ` UITextView`.
|
||||
*/
|
||||
- (void)sendCurrentMessage;
|
||||
|
||||
/**
|
||||
Handle image attachment
|
||||
Save the image in user's photos library when 'isPhotoLibraryAsset' flag is NO and auto saving is enabled.
|
||||
@@ -355,4 +360,9 @@ typedef enum : NSUInteger
|
||||
*/
|
||||
- (void)pasteText:(NSString*)text;
|
||||
|
||||
/**
|
||||
The current attributed text message in message composer.
|
||||
*/
|
||||
@property (nonatomic) NSAttributedString *attributedTextMessage;
|
||||
|
||||
@end
|
||||
|
||||
@@ -277,22 +277,27 @@
|
||||
}
|
||||
else if (button == self.rightInputToolbarButton && self.textMessage.length)
|
||||
{
|
||||
// This forces an autocorrect event to happen when "Send" is pressed, which is necessary to accept a pending correction on send
|
||||
self.textMessage = [NSString stringWithFormat:@"%@ ", self.textMessage];
|
||||
self.textMessage = [self.textMessage substringToIndex:[self.textMessage length]-1];
|
||||
[self sendCurrentMessage];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *message = self.textMessage;
|
||||
|
||||
// Reset message, disable view animation during the update to prevent placeholder distorsion.
|
||||
[UIView setAnimationsEnabled:NO];
|
||||
self.textMessage = nil;
|
||||
[UIView setAnimationsEnabled:YES];
|
||||
|
||||
// Send button has been pressed
|
||||
if (message.length && [self.delegate respondsToSelector:@selector(roomInputToolbarView:sendTextMessage:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self sendTextMessage:message];
|
||||
}
|
||||
- (void)sendCurrentMessage
|
||||
{
|
||||
// This forces an autocorrect event to happen when "Send" is pressed, which is necessary to accept a pending correction on send
|
||||
self.textMessage = [NSString stringWithFormat:@"%@ ", self.textMessage];
|
||||
self.textMessage = [self.textMessage substringToIndex:[self.textMessage length]-1];
|
||||
|
||||
NSString *message = self.textMessage;
|
||||
|
||||
// Reset message, disable view animation during the update to prevent placeholder distorsion.
|
||||
[UIView setAnimationsEnabled:NO];
|
||||
self.textMessage = nil;
|
||||
[UIView setAnimationsEnabled:YES];
|
||||
|
||||
// Send button has been pressed
|
||||
if (message.length && [self.delegate respondsToSelector:@selector(roomInputToolbarView:sendTextMessage:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self sendTextMessage:message];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user