mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Don't allow input on rss groups.
This commit is contained in:
parent
9bee25f6c6
commit
7acfa40915
4 changed files with 19 additions and 2 deletions
|
@ -564,6 +564,16 @@ typedef enum : NSUInteger {
|
|||
return !groupThread.isLocalUserInGroup;
|
||||
}
|
||||
|
||||
- (BOOL)isRSSGroup
|
||||
{
|
||||
if (![_thread isKindOfClass:[TSGroupThread class]]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
TSGroupThread *groupThread = (TSGroupThread *)self.thread;
|
||||
return groupThread.isRSS;
|
||||
}
|
||||
|
||||
- (void)hideInputIfNeeded
|
||||
{
|
||||
if (_peek) {
|
||||
|
@ -572,7 +582,7 @@ typedef enum : NSUInteger {
|
|||
return;
|
||||
}
|
||||
|
||||
if (self.userLeftGroup) {
|
||||
if (self.userLeftGroup || self.isRSSGroup) {
|
||||
self.inputToolbar.hidden = YES; // user has requested they leave the group. further sends disallowed
|
||||
[self dismissKeyBoard];
|
||||
} else {
|
||||
|
|
|
@ -16,6 +16,7 @@ extern NSString *const TSGroupThread_NotificationKey_UniqueId;
|
|||
@interface TSGroupThread : TSThread
|
||||
|
||||
@property (nonatomic, strong) TSGroupModel *groupModel;
|
||||
@property (nonatomic, readonly) BOOL isRSS;
|
||||
|
||||
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
|
||||
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel
|
||||
|
|
|
@ -266,6 +266,12 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific
|
|||
return [self.class stableColorNameForNewConversationWithString:[self threadIdFromGroupId:groupId]];
|
||||
}
|
||||
|
||||
- (BOOL)isRSS
|
||||
{
|
||||
NSString *groupID = [[NSString alloc] initWithData:self.groupModel.groupId encoding:NSUTF8StringEncoding];
|
||||
return groupID != nil && [groupID containsString:@"rss:"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -7,7 +7,7 @@ public final class LokiRSSFeed : NSObject {
|
|||
@objc public let isDeletable: Bool
|
||||
|
||||
@objc public init(id: String, server: String, displayName: String, isDeletable: Bool) {
|
||||
self.id = id
|
||||
self.id = "rss://\(id)"
|
||||
self.server = server
|
||||
self.displayName = displayName
|
||||
self.isDeletable = isDeletable
|
||||
|
|
Loading…
Reference in a new issue