Fix open group joining

pull/229/head
nielsandriesse 4 years ago
parent 563a148b93
commit a332f88fda

@ -144,7 +144,6 @@ final class JoinPublicChatVC : BaseVC, UIPageViewControllerDataSource, UIPageVie
}
LokiPublicChatManager.shared.addChat(server: urlAsString, channel: channelID)
.done(on: .main) { [weak self] _ in
let _ = LokiPublicChatAPI.getMessages(for: channelID, on: urlAsString)
let _ = LokiPublicChatAPI.setDisplayName(to: displayName, on: urlAsString)
let _ = LokiPublicChatAPI.setProfilePictureURL(to: profilePictureURL, using: profileKey, on: urlAsString)
let _ = LokiPublicChatAPI.join(channelID, on: urlAsString)

@ -603,7 +603,9 @@ NS_ASSUME_NONNULL_BEGIN
if (groupThread) {
// Loki: Ignore closed group message if needed
if ([LKClosedGroupsProtocol shouldIgnoreClosedGroupMessage:dataMessage inThread:groupThread wrappedIn:envelope]) { return; }
if (groupThread.groupModel.groupType == closedGroup) {
if ([LKClosedGroupsProtocol shouldIgnoreClosedGroupMessage:dataMessage inThread:groupThread wrappedIn:envelope]) { return; }
}
if (dataMessage.group.type != SSKProtoGroupContextTypeUpdate) {
if (![groupThread isCurrentUserInGroupWithTransaction:transaction]) {
@ -1370,7 +1372,8 @@ NS_ASSUME_NONNULL_BEGIN
switch (dataMessage.group.type) {
case SSKProtoGroupContextTypeUpdate: {
// Loki: Ignore updates from non-admins (deprecated)
if (oldGroupThread != nil && [LKClosedGroupsProtocol shouldIgnoreClosedGroupUpdateMessage:dataMessage inThread:oldGroupThread wrappedIn:envelope]) {
if (oldGroupThread != nil && oldGroupThread.groupModel.groupType == closedGroup
&& [LKClosedGroupsProtocol shouldIgnoreClosedGroupUpdateMessage:dataMessage inThread:oldGroupThread wrappedIn:envelope]) {
return nil;
}
// Ensures that the thread exists but don't update it.

Loading…
Cancel
Save