Skip to content

Commit

Permalink
6.3.0 (#1047)
Browse files Browse the repository at this point in the history
- Fix muc status code handling for biboumi
- Implement XEP-0425: Moderated Message Retraction
- Implement XEP-0490: Message Displayed Synchronization
- Better default chat background for light and dark mode
- Fix crashes when used with very old Openfire server
- Improve cert error message
- Highlight selected chat on iPad and macOS
- Mark pinned chats with icon instead of color
- Completely rewrite privacy settings (thanks Vaidik)
- Automatically focus chat input and open keyboard when entering chat
- Allow SASL PLAIN on servers not supporting SCRAM but SASL2
- Completely new debug menu
- Add new privacy setting to allow/block calls from strangers
- Don't block callkit in china anymore
- Fix several other crashes and UI bugs
  • Loading branch information
tmolitor-stud-tu authored Apr 29, 2024
2 parents d074852 + 241905c commit f374800
Show file tree
Hide file tree
Showing 63 changed files with 2,236 additions and 1,491 deletions.
36 changes: 14 additions & 22 deletions .github/ISSUE_TEMPLATE/BugReport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,27 @@ body:
- type: input
id: ios_version
attributes:
label: iOS system version
label: iOS system version (if applicable)
description: What iOS version are you using? Open Settings, scroll down until "General", select "Info" and report "Software version".
placeholder: "14.7"
validations:
required: false
- type: input
id: ios_monal__version
attributes:
label: iOS Monal version
description: What Monal version are you using? Open Monal, select top left icon, scoll down until "Version".
placeholder: "5.0.1"
validations:
required: false
- type: input
id: mac_version
attributes:
label: macOS system version
label: macOS system version (if applicable)
description: What macOS version are you using?
placeholder: "14.7"
validations:
required: false
- type: input
id: mac_monal__version
id: monal_version
attributes:
label: macOS Monal version
description: What Monal version are you using?
placeholder: "5.0.1"
label: Monal version
description: What Monal version are you using? Open Monal, select top left icon, scoll down until "Version".
placeholder: "1.0"
validations:
required: false
required: true
- type: input
id: xmpp_server
attributes:
Expand Down Expand Up @@ -131,13 +123,13 @@ body:
options:
- label: I have checked if my issue can be solved with [Considerations for XMPP users](https://github.com/monal-im/Monal/wiki/Considerations-for-XMPP-users) and [Considerations for XMPP server admins](https://github.com/monal-im/Monal/wiki/Considerations-for-XMPP-server-admins)
required: true
- type: checkboxes
id: cross-check-checkbox
attributes:
label: Related Issues
options:
- label: I have cross-checked this overview https://github.com/monal-im/Monal/issues/322 as well as filtered for related labels https://github.com/monal-im/Monal/labels
required: true
# - type: checkboxes
# id: cross-check-checkbox
# attributes:
# label: Related Issues
# options:
# - label: I have cross-checked this overview https://github.com/monal-im/Monal/issues/322 as well as filtered for related labels https://github.com/monal-im/Monal/labels
# required: true
- type: checkboxes
id: xep-checkbox
attributes:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/stable.build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,27 @@ jobs:
run: xcrun altool --upload-app --file ./Monal/build/app/Monal.pkg --type macos --asc-provider S8D843U34Y -u "$(cat /Users/ci/apple_connect_upload_mail.txt)" -p "$(cat /Users/ci/apple_connect_upload_secret.txt)" --primary-bundle-id maccatalyst.G7YU7X7KRJ.SworIM
# - name: Update xmpp.org client list with new timestamp
# run: ./scripts/push_xmpp.org.sh
- name: Extract version number and changelog from newest merge commit
id: releasenotes
run: |
buildNumber=$(git tag --sort="v:refname" |grep "Build_iOS" | tail -n1 | sed 's/Build_iOS_//g')
echo "tag=Build_iOS_$buildNumber" >> "$GITHUB_OUTPUT"
echo "name=$(git log -n 1 --merges --pretty=format:%s)" >> "$GITHUB_OUTPUT"
echo "notes=$(git log -n 1 --merges --pretty=format:%b)" >> "$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.releasenotes.outputs.name }}
tag_name: ${{ steps.releasenotes.outputs.tag }}
target_commitish: stable
generate_release_notes: false
body: ${{ steps.releasenotes.outputs.notes }}
files: |
./Monal/build/ipa/Monal.ipa
./Monal/build/app/Monal.zip
fail_on_unmatched_files: true
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
- uses: actions/upload-artifact@v3
with:
name: monal-catalyst-pkg
Expand Down
28 changes: 9 additions & 19 deletions Monal/Classes/AVCallUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,33 +525,23 @@ struct AVCallUI: View {
}
.buttonStyle(BorderlessButtonStyle())

if MLCallState(rawValue:call.state) == .connected || MLCallState(rawValue:call.state) == .reconnecting {
Spacer().frame(width: 32)
Button(action: {
call.speaker = !call.speaker
}) {
if #available(iOS 15, *) {
//the button somehow does not work in iOS 15 and we don't know how to fix that
//--> don't show the button on iOS 14 and 15
if #available(iOS 16, *) {
if MLCallState(rawValue:call.state) == .connected || MLCallState(rawValue:call.state) == .reconnecting {
Spacer().frame(width: 32)
Button(action: {
call.speaker = !call.speaker
}) {
Image(systemName: "speaker.wave.2.circle.fill")
.resizable()
.frame(width: 64.0, height: 64.0)
.symbolRenderingMode(.palette)
.foregroundStyle(call.speaker ? .black : .white, call.speaker ? .white : .black)
.shadow(radius: 7)
} else {
ZStack {
Image(systemName: "circle.fill")
.resizable()
.frame(width: 64.0, height: 64.0)
.accentColor(call.speaker ? .black : .white)
Image(systemName: "speaker.wave.2.circle.fill")
.resizable()
.frame(width: 64.0, height: 64.0)
.accentColor(call.speaker ? .white : .black)
.shadow(radius: 7)
}
}
.buttonStyle(BorderlessButtonStyle())
}
.buttonStyle(BorderlessButtonStyle())
}

Spacer()
Expand Down
119 changes: 80 additions & 39 deletions Monal/Classes/ActiveChatsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ @implementation ActiveChatsViewController

static NSMutableSet* _mamWarningDisplayed;
static NSMutableSet* _smacksWarningDisplayed;
static NSMutableSet* _pushWarningDisplayed;

+(void) initialize
{
_mamWarningDisplayed = [NSMutableSet new];
_smacksWarningDisplayed = [NSMutableSet new];
_pushWarningDisplayed = [NSMutableSet new];
}

#pragma mark view lifecycle
Expand Down Expand Up @@ -113,6 +115,7 @@ -(void) viewDidLoad
[nc addObserver:self selector:@selector(handleNewMessage:) name:kMonalDeletedMessageNotice object:nil];
[nc addObserver:self selector:@selector(messageSent:) name:kMLMessageSentToContact object:nil];
[nc addObserver:self selector:@selector(handleDeviceRotation) name:UIDeviceOrientationDidChangeNotification object:nil];
[nc addObserver:self selector:@selector(showWarningsIfNeeded) name:kMonalFinishedCatchup object:nil];

[_chatListTable registerNib:[UINib nibWithNibName:@"MLContactCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"ContactCell"];

Expand Down Expand Up @@ -392,40 +395,6 @@ -(void) viewDidAppear:(BOOL) animated
{
DDLogDebug(@"active chats view did appear");
[super viewDidAppear:animated];

for(NSDictionary* accountDict in [[DataLayer sharedInstance] enabledAccountList])
{
NSNumber* accountNo = accountDict[kAccountID];
xmpp* account = [[MLXMPPManager sharedInstance] getConnectedAccountForID:accountNo];
if(!account)
@throw [NSException exceptionWithName:@"RuntimeException" reason:@"Connected xmpp* object for accountNo is nil!" userInfo:accountDict];
if(![_mamWarningDisplayed containsObject:accountNo] && account.accountState >= kStateBound && account.connectionProperties.accountDiscoDone)
{
if(!account.connectionProperties.supportsMam2)
{
UIAlertController* messageAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Account %@", @""), account.connectionProperties.identity.jid] message:NSLocalizedString(@"Your server does not support MAM (XEP-0313). That means you could frequently miss incoming messages!! You should switch your server or talk to the server admin to enable this!", @"") preferredStyle:UIAlertControllerStyleAlert];
[messageAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"") style:UIAlertActionStyleCancel handler:^(UIAlertAction* action __unused) {
[_mamWarningDisplayed addObject:accountNo];
}]];
[self presentViewController:messageAlert animated:YES completion:nil];
}
else
[_mamWarningDisplayed addObject:accountNo];
}
if(![_smacksWarningDisplayed containsObject:accountNo] && account.accountState >= kStateBound)
{
if(!account.connectionProperties.supportsSM3)
{
UIAlertController* messageAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Account %@", @""), account.connectionProperties.identity.jid] message:NSLocalizedString(@"Your server does not support Stream Management (XEP-0198). That means your outgoing messages can get lost frequently!! You should switch your server or talk to the server admin to enable this!", @"") preferredStyle:UIAlertControllerStyleAlert];
[messageAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"") style:UIAlertActionStyleCancel handler:^(UIAlertAction* action __unused) {
[_smacksWarningDisplayed addObject:accountNo];
}]];
[self presentViewController:messageAlert animated:YES completion:nil];
}
else
[_smacksWarningDisplayed addObject:accountNo];
}
}
}

-(void) didReceiveMemoryWarning
Expand Down Expand Up @@ -466,9 +435,66 @@ -(void) segueToIntroScreensIfNeeded
}
if(![[HelperTools defaultsDB] boolForKey:@"HasSeenPrivacySettings"])
{
[self performSegueWithIdentifier:@"showPrivacySettings" sender:self];
[self showPrivacySettings];
return;
}

[self showWarningsIfNeeded];
}

-(void) showWarningsIfNeeded
{
dispatch_async(dispatch_get_main_queue(), ^{
for(NSDictionary* accountDict in [[DataLayer sharedInstance] enabledAccountList])
{
NSNumber* accountNo = accountDict[kAccountID];
xmpp* account = [[MLXMPPManager sharedInstance] getConnectedAccountForID:accountNo];
if(!account)
@throw [NSException exceptionWithName:@"RuntimeException" reason:@"Connected xmpp* object for accountNo is nil!" userInfo:accountDict];

if(![_mamWarningDisplayed containsObject:accountNo] && account.accountState >= kStateBound && account.connectionProperties.accountDiscoDone)
{
if(!account.connectionProperties.supportsMam2)
{
UIAlertController* messageAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Account %@", @""), account.connectionProperties.identity.jid] message:NSLocalizedString(@"Your server does not support MAM (XEP-0313). That means you could frequently miss incoming messages!! You should switch your server or talk to the server admin to enable this!", @"") preferredStyle:UIAlertControllerStyleAlert];
[messageAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"") style:UIAlertActionStyleCancel handler:^(UIAlertAction* action __unused) {
[_mamWarningDisplayed addObject:accountNo];
}]];
[self presentViewController:messageAlert animated:YES completion:nil];
}
else
[_mamWarningDisplayed addObject:accountNo];
}

if(![_smacksWarningDisplayed containsObject:accountNo] && account.accountState >= kStateBound)
{
if(!account.connectionProperties.supportsSM3)
{
UIAlertController* messageAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Account %@", @""), account.connectionProperties.identity.jid] message:NSLocalizedString(@"Your server does not support Stream Management (XEP-0198). That means your outgoing messages can get lost frequently!! You should switch your server or talk to the server admin to enable this!", @"") preferredStyle:UIAlertControllerStyleAlert];
[messageAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"") style:UIAlertActionStyleCancel handler:^(UIAlertAction* action __unused) {
[_smacksWarningDisplayed addObject:accountNo];
}]];
[self presentViewController:messageAlert animated:YES completion:nil];
}
else
[_smacksWarningDisplayed addObject:accountNo];
}

if(![_pushWarningDisplayed containsObject:accountNo] && account.accountState >= kStateBound && account.connectionProperties.accountDiscoDone)
{
if(!account.connectionProperties.supportsMam2)
{
UIAlertController* messageAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Account %@", @""), account.connectionProperties.identity.jid] message:NSLocalizedString(@"Your server does not support PUSH (XEP-0357). That means you have to manually open the app to retrieve new incoming messages!! You should switch your server or talk to the server admin to enable this!", @"") preferredStyle:UIAlertControllerStyleAlert];
[messageAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Close", @"") style:UIAlertActionStyleCancel handler:^(UIAlertAction* action __unused) {
[_pushWarningDisplayed addObject:accountNo];
}]];
[self presentViewController:messageAlert animated:YES completion:nil];
}
else
[_pushWarningDisplayed addObject:accountNo];
}
}
});
}

-(void) openConversationPlaceholder:(MLContact*) contact
Expand All @@ -484,7 +510,8 @@ -(void) openConversationPlaceholder:(MLContact*) contact

-(void) showPrivacySettings
{
[self performSegueWithIdentifier:@"showPrivacySettings" sender:self];
UIViewController* view = [[SwiftuiInterface new] makeViewWithName:@"ActiveChatsPrivacySettings"];
[self presentViewController:view animated:YES completion:^{}];
}

-(void) showSettings
Expand Down Expand Up @@ -713,16 +740,30 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

MLContact* chatContact = nil;
// Select correct contact array
if(indexPath.section == pinnedChats) {
if(indexPath.section == pinnedChats)
chatContact = [self.pinnedContacts objectAtIndex:indexPath.row];
} else {
else
chatContact = [self.unpinnedContacts objectAtIndex:indexPath.row];
}

// Display msg draft or last msg
MLMessage* messageRow = [[DataLayer sharedInstance] lastMessageForContact:chatContact.contactJid forAccount:chatContact.accountId];

[cell initCell:chatContact withLastMessage:messageRow];

cell.selectionStyle = UITableViewCellSelectionStyleNone;

// Highlight the selected chat
if([MLNotificationManager sharedInstance].currentContact != nil && [chatContact isEqual:[MLNotificationManager sharedInstance].currentContact])
{
cell.backgroundColor = [UIColor lightGrayColor];
cell.statusText.textColor = [UIColor whiteColor];
}
else
{
cell.backgroundColor = [UIColor clearColor];
cell.statusText.textColor = [UIColor lightGrayColor];
}

return cell;
}

Expand Down
7 changes: 6 additions & 1 deletion Monal/Classes/DataLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern NSString* const kDomain;
extern NSString* const kEnabled;
extern NSString* const kNeedsPasswordMigration;
extern NSString* const kSupportsSasl2;
extern NSString* const kPlainActivated;

extern NSString* const kServer;
extern NSString* const kPort;
Expand Down Expand Up @@ -163,6 +164,8 @@ extern NSString* const kMessageTypeFiletransfer;

-(BOOL) pinSasl2ForAccount:(NSNumber*) accountNo;
-(BOOL) isSasl2PinnedForAccount:(NSNumber*) accountNo;
-(BOOL) isPlainActivatedForAccount:(NSNumber*) accountNo;
-(BOOL) deactivatePlainForAccount:(NSNumber*) accountNo;

-(NSMutableDictionary* _Nullable) readStateForAccount:(NSNumber*) accountNo;
-(void) persistState:(NSDictionary*) state forAccount:(NSNumber*) accountNo;
Expand Down Expand Up @@ -211,7 +214,9 @@ extern NSString* const kMessageTypeFiletransfer;
-(void) deleteMessageHistory:(NSNumber *) messageNo;
-(void) deleteMessageHistoryLocally:(NSNumber*) messageNo;
-(void) updateMessageHistory:(NSNumber*) messageNo withText:(NSString*) newText;
-(NSNumber* _Nullable) getHistoryIDForMessageId:(NSString*) messageid from:(NSString*) from actualFrom:(NSString* _Nullable) actualFrom participantJid:(NSString* _Nullable) participantJid andAccount:(NSNumber*) accountNo;
-(NSNumber* _Nullable) getLMCHistoryIDForMessageId:(NSString*) messageid from:(NSString*) from actualFrom:(NSString* _Nullable) actualFrom participantJid:(NSString* _Nullable) participantJid andAccount:(NSNumber*) accountNo;
-(NSNumber* _Nullable) getRetractionHistoryIDForMessageId:(NSString*) messageid from:(NSString*) from actualFrom:(NSString* _Nullable) actualFrom participantJid:(NSString* _Nullable) participantJid andAccount:(NSNumber*) accountNo;
-(NSNumber* _Nullable) getRetractionHistoryIDForModeratedStanzaId:(NSString*) stanzaId from:(NSString*) from andAccount:(NSNumber*) accountNo;

-(NSDate* _Nullable) returnTimestampForQuote:(NSNumber*) historyID;
-(BOOL) checkLMCEligible:(NSNumber*) historyID encrypted:(BOOL) encrypted historyBaseID:(NSNumber* _Nullable) historyBaseID;
Expand Down
Loading

0 comments on commit f374800

Please sign in to comment.