Skip to content

Commit

Permalink
Merge branch 'master' into better-voice-message-handling
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel <[email protected]>
  • Loading branch information
DanielStandfest authored Dec 16, 2024
2 parents b1797e5 + b5adb98 commit c9964ad
Show file tree
Hide file tree
Showing 168 changed files with 4,058 additions and 1,652 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: 🐞 Bug report
about: Create a report to help us improve
title: ''
labels: 0. Needs triage, bug
Expand Down
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
blank_issues_enabled: false
contact_links:
- name: 🗺️ Feature request for the full Nextcloud Talk suite
url: https://github.com/nextcloud/spreed/issues/new/choose
about: Suggest an idea for Nextcloud Talk for all users, client and server
- name: ❓ Community Support and Help
url: https://help.nextcloud.com/
about: Configuration, webserver/proxy or performance issues and other questions
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Feature request
name: 🚀 Feature request specifically for Nextcloud Talk iOS
about: Suggest an idea for Nextcloud Talk iOS
title: ''
labels: 0. Needs triage, enhancement
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/localizable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:
jobs:
check-localizable:
name: Check for localizable changes
runs-on: macOS-12
runs-on: macOS-15

steps:
- name: Checkout app
Expand All @@ -43,11 +43,11 @@ jobs:
- name: Install dependencies
run: |
pip3 install pyspelling
brew install aspell pyspelling
- name: Spell check
run: |
python3 -m pyspelling
pyspelling
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: The get-github-handles-from-website action
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
id: scrape
with:
website: 'https://nextcloud.com/team/'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Cocoapods
uses: maxim-lobanov/[email protected]
with:
version: latest

- name: Set up dependencies talk-ios
run: |
pod install
pod install
- name: Build NextcloudTalk iOS for testing
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ ThirdParty/WebRTC.xcframework
testResult.xcresult
dictionary.dic
DerivedData
build
4 changes: 4 additions & 0 deletions .pyspelling.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ CallKit
Unban
unban
Zammad
Strikethrough
Unarchive
unarchive
unarchived
354 changes: 175 additions & 179 deletions NextcloudTalk.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion NextcloudTalk/AddParticipantsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

cell.labelTitle.text = participant.name;
[cell.contactImage setActorAvatarForId:participant.userId withType:participant.source withDisplayName:participant.name withRoomToken:_room.token];

TalkAccount *account = self->_room.account;

if (account) {
[cell.contactImage setActorAvatarForId:participant.userId withType:participant.source withDisplayName:participant.name withRoomToken:_room.token using:account];
}

UIImage *selectionImage = [UIImage systemImageNamed:@"circle"];
UIColor *selectionImageColor = [UIColor tertiaryLabelColor];
Expand Down
46 changes: 46 additions & 0 deletions NextcloudTalk/AiSummaryController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: GPL-3.0-or-later
//

import Foundation

public typealias RoomInternalIdString = String

public class AiSummaryTask {
public var taskIds = [Int]()
public var outputs = [String]()
}

public class AiSummaryController {

public static let shared = AiSummaryController()

public var generateSummaryTasks = [RoomInternalIdString: AiSummaryTask]()

public func addSummaryTaskId(forRoomInternalId internalId: String, withTaskId taskId: Int) {
let task = generateSummaryTasks[internalId, default: AiSummaryTask()]

task.taskIds.append(taskId)
generateSummaryTasks[internalId] = task
}

public func markSummaryTaskAsDone(forRoomInternalId internalId: String, withTaskId taskId: Int, withOutput output: String) {
guard let task = generateSummaryTasks[internalId] else { return }

task.taskIds.removeAll(where: { $0 == taskId })
task.outputs.append(output)
}

@discardableResult
public func finalizeSummaryTask(forRoomInternalId internalId: String) -> [String] {
let result = generateSummaryTasks[internalId]?.outputs ?? []
generateSummaryTasks.removeValue(forKey: internalId)

return result
}

public func getSummaryTaskIds(forRoomInternalId internalId: String) -> [Int] {
return generateSummaryTasks[internalId]?.taskIds ?? []
}
}
73 changes: 73 additions & 0 deletions NextcloudTalk/AiSummaryViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: GPL-3.0-or-later
//

import UIKit

class AiSummaryViewController: UIViewController {

private var summaryText: String = ""

@IBOutlet weak var warningView: UIView!
@IBOutlet weak var warningTextLabel: UILabel!
@IBOutlet weak var saveToNoteToSelf: NCButton!
@IBOutlet weak var summaryTextView: UITextView!

init(summaryText: String) {
self.summaryText = summaryText

super.init(nibName: nil, bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func viewDidLoad() {
super.viewDidLoad()

NCAppBranding.styleViewController(self)

let barButtonItem = UIBarButtonItem(title: nil, style: .plain, target: nil, action: nil)
barButtonItem.primaryAction = UIAction(title: NSLocalizedString("Close", comment: ""), handler: { [unowned self] _ in
self.dismiss(animated: true)
})
self.navigationItem.rightBarButtonItems = [barButtonItem]

saveToNoteToSelf.setTitle(NSLocalizedString("Save to 'Note to self'", comment: ""), for: .normal)
saveToNoteToSelf.setButtonStyle(style: .primary)

warningView.layer.cornerRadius = 8
warningView.layer.borderColor = NCAppBranding.placeholderColor().cgColor
warningView.layer.borderWidth = 1
warningView.layer.masksToBounds = true

warningTextLabel.text = NSLocalizedString("This summary is AI generated and may contain mistakes.", comment: "")

summaryTextView.text = self.summaryText
}

@IBAction func saveToNoteToSelfPressed(_ sender: Any) {
let activeAccount = NCDatabaseManager.sharedInstance().activeAccount()

self.saveToNoteToSelf.setButtonEnabled(enabled: false)

NCAPIController.sharedInstance().getNoteToSelfRoom(forAccount: activeAccount) { roomDict, error in
if error == nil, let room = NCRoom(dictionary: roomDict, andAccountId: activeAccount.accountId) {

NCAPIController.sharedInstance().sendChatMessage(self.summaryTextView.text, toRoom: room.token, displayName: nil, replyTo: -1, referenceId: nil, silently: false, for: activeAccount) { error in
if error == nil {
NotificationPresenter.shared().present(text: NSLocalizedString("Added note to self", comment: ""), dismissAfterDelay: 5.0, includedStyle: .success)
} else {
self.saveToNoteToSelf.setButtonEnabled(enabled: true)
NotificationPresenter.shared().present(text: NSLocalizedString("An error occurred while adding note", comment: ""), dismissAfterDelay: 5.0, includedStyle: .error)
}
}
} else {
self.saveToNoteToSelf.setButtonEnabled(enabled: true)
NotificationPresenter.shared().present(text: NSLocalizedString("An error occurred while adding note", comment: ""), dismissAfterDelay: 5.0, includedStyle: .error)
}
}
}
}
111 changes: 111 additions & 0 deletions NextcloudTalk/AiSummaryViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AiSummaryViewController" customModule="NextcloudTalk" customModuleProvider="target">
<connections>
<outlet property="saveToNoteToSelf" destination="d2N-C7-sYL" id="gAs-3g-Nhb"/>
<outlet property="summaryTextView" destination="kWW-BG-TWM" id="KP2-kO-EM5"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outlet property="warningTextLabel" destination="gUd-g3-bka" id="9Le-zN-hR3"/>
<outlet property="warningView" destination="aZn-kU-a4A" id="rry-r5-a8s"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="kWW-BG-TWM">
<rect key="frame" x="10" y="102" width="394" height="652"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<mutableString key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut lLorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in </mutableString>
<color key="textColor" systemColor="labelColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="HDS-I5-5AY">
<rect key="frame" x="10" y="764" width="394" height="98"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aZn-kU-a4A" userLabel="Warning View">
<rect key="frame" x="77" y="0.0" width="240" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AI Warning" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gUd-g3-bka">
<rect key="frame" x="15" y="10" width="215" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4zd-CF-bax">
<rect key="frame" x="0.0" y="0.0" width="5" height="50"/>
<color key="backgroundColor" systemColor="systemYellowColor"/>
<constraints>
<constraint firstAttribute="width" constant="5" id="rRU-wl-5VU"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="gUd-g3-bka" secondAttribute="bottom" constant="10" id="598-zr-uee"/>
<constraint firstItem="gUd-g3-bka" firstAttribute="top" secondItem="aZn-kU-a4A" secondAttribute="top" constant="10" id="Cct-5f-OBw"/>
<constraint firstItem="4zd-CF-bax" firstAttribute="leading" secondItem="aZn-kU-a4A" secondAttribute="leading" id="TU1-V9-cjP"/>
<constraint firstItem="gUd-g3-bka" firstAttribute="leading" secondItem="4zd-CF-bax" secondAttribute="trailing" constant="10" id="dvf-Bd-Lav"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="nAq-tm-7xg"/>
<constraint firstItem="4zd-CF-bax" firstAttribute="top" secondItem="aZn-kU-a4A" secondAttribute="top" id="naM-oV-9qs"/>
<constraint firstAttribute="trailing" secondItem="gUd-g3-bka" secondAttribute="trailing" constant="10" id="nw6-dW-faE"/>
<constraint firstAttribute="bottom" secondItem="4zd-CF-bax" secondAttribute="bottom" id="tDg-eA-ama"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d2N-C7-sYL" userLabel="Save to note to self" customClass="NCButton" customModule="NextcloudTalk" customModuleProvider="target">
<rect key="frame" x="148" y="58" width="98" height="40"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" id="3r9-cH-CLj"/>
<constraint firstAttribute="height" constant="40" id="hGU-lZ-L60"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<inset key="contentEdgeInsets" minX="24" minY="0.0" maxX="24" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button">
<color key="titleColor" systemColor="labelColor"/>
</state>
<connections>
<action selector="saveToNoteToSelfPressed:" destination="-1" eventType="touchUpInside" id="KvC-u8-Hcf"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="HDS-I5-5AY" firstAttribute="top" secondItem="kWW-BG-TWM" secondAttribute="bottom" constant="10" id="C6w-nB-yaf"/>
<constraint firstItem="kWW-BG-TWM" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="10" id="L3p-dS-lyN"/>
<constraint firstItem="HDS-I5-5AY" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="10" id="ZvA-oB-7uy"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="HDS-I5-5AY" secondAttribute="bottom" id="a1b-FO-AY1"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="kWW-BG-TWM" secondAttribute="trailing" constant="10" id="eih-rD-OcA"/>
<constraint firstItem="kWW-BG-TWM" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="10" id="m5L-aD-vsu"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="HDS-I5-5AY" secondAttribute="trailing" constant="10" id="zeZ-gu-9BY"/>
</constraints>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<point key="canvasLocation" x="82.608695652173921" y="91.741071428571431"/>
</view>
</objects>
<resources>
<systemColor name="labelColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemYellowColor">
<color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
3 changes: 2 additions & 1 deletion NextcloudTalk/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[NCUtils removeOldLogfiles];
});

[NCUtils log:[NSString stringWithFormat:@"Starting %@, version %@", NSBundle.mainBundle.bundleIdentifier, [NCAppBranding getAppVersionString]]];
UIDevice *currentDevice = [UIDevice currentDevice];
[NCUtils log:[NSString stringWithFormat:@"Starting %@, version %@, %@ %@, model %@", NSBundle.mainBundle.bundleIdentifier, [NCAppBranding getAppVersionString], currentDevice.systemName, currentDevice.systemVersion, currentDevice.model]];

//Init rooms manager to start receiving NSNotificationCenter notifications
[NCRoomsManager sharedInstance];
Expand Down
Loading

0 comments on commit c9964ad

Please sign in to comment.