-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `Development`: Preview message detail view (#77) * Format * Preview MessageCell * Rename showHeader: isHeaderVisible * BaseMessage+IsContinuation * Make ConversationViewModel internal * Fix warning: - Reference to property 'stompClient' in closure requires explicit use of 'self' to make capture semantics explicit; this is an error in Swift 6 * Preview ReactionsView * Preview ConversationDaySection * Preview MessageDetailView * `Communication`: Usability of the conversation and thread views (#69) * Refine MessageCell * Align reaction leading * Apply system to send message overlay * Highlight message, not author * Pass isEmojiPickerButtonVisible through the environment * Hide image by height, not opacity * Inflect "reply" * `Communication`: Support user mentions and channel references (#47) * Format * Update overlay modifier - Deprecated: https://developer.apple.com/documentation/swiftui/view/overlay(_:alignment:) * Fix runtime warning: Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates. * Use getCourseMembers(courseId:searchLoginOrName:) API * Fix warning: - Deprecated: https://developer.apple.com/documentation/uikit/uiapplication/1622918-applicationiconbadgenumber * Add getChannelsPublicOverview * Duplicate SendMessageMemberPickerModel * Move SendMessageView * Improve search * Dependency injection * [R]un when this view initially appears * Stick to design system * Rename show*: is*Presented * Create SendMessageViewModel * Make Observables final * Move is[Modal]Presented * Test SendMessageViewModel * `Communication`: Navigate to exercises and lectures (#81) * Fix sheet * Add OpenURLAction * Check host * Inject UserSession * Split NavigationController * Format * `Exercise`: Add pull-to-refresh to ExerciseListView and ExerciseDetailView (#78) * initial pull-to-refresh feature * update apollon-ios-module dependency * `Modeling Exercise`: Improve Submit Button (#79) * add alert after submitting diagram * update Apollon-iOS-Module version * Improve submit button with colors * `Development`: Refactor ExerciseView (#82) * Make SendMessageViewModel primary * Initialize view model at caller * Move sendMessageType * Move isEditMode: isEditing * Format * Distinguish presentation * Organize ConversationViewModel * Extract button action * Inject dependencies * Remove conversationViewModel dependency * Create SendMessageViewModelDelegate; separate isLoading * Fix warning: - redundant_type_annotation * `Communication`: Restore draft message (#83) * Rename folder * Create schema * Fix runtime: Object 0x600000494860 of class AnyRepository deallocated with non-zero retain count 2. This object's deinit, or something called from it, may have created a strong reference to self which outlived deinit, resulting in a dangling reference. * Store context * Create MessagesRepository * Fix issue: #83 (comment) * Add inverse relationship: https://www.hackingwithswift.com/quick-start/swiftdata/how-to-create-one-to-many-relationships * Change url to host; fix error: testRoundtrip(): failed: caught error: "SwiftDataError(_error: SwiftData.SwiftDataError._Error.unsupportedPredicate)" * Insert course model * Add message model * performOnDisappear * log verbose begin context access * Rename sendMessageType: configuration --------- Co-authored-by: Alexander Görtzen <[email protected]>
- Loading branch information
1 parent
ed4fc47
commit 84de14d
Showing
44 changed files
with
2,419 additions
and
993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
ArtemisKit/Sources/Messages/Models/BaseMessage+IsContinuation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// BaseMessage+IsContinuation.swift | ||
// | ||
// | ||
// Created by Nityananda Zbil on 07.02.24. | ||
// | ||
|
||
import Foundation | ||
import SharedModels | ||
|
||
// swiftlint:disable:next identifier_name | ||
private let MAX_MINUTES_FOR_GROUPING_MESSAGES = 5 | ||
|
||
extension BaseMessage { | ||
/// Whether the same author messaged multiple times within 5 minutes. | ||
func isContinuation(of message: some BaseMessage) -> Bool { | ||
guard author == message.author, | ||
let lhs = creationDate, | ||
let rhs = message.creationDate else { | ||
return false | ||
} | ||
|
||
return lhs < rhs.addingTimeInterval(TimeInterval(MAX_MINUTES_FOR_GROUPING_MESSAGES * 60)) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
ArtemisKit/Sources/Messages/Models/ChannelIdAndNameDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// ChannelIdAndNameDTO.swift | ||
// | ||
// | ||
// Created by Nityananda Zbil on 02.12.23. | ||
// | ||
|
||
struct ChannelIdAndNameDTO: Codable, Identifiable { | ||
let id: Int | ||
let name: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Schema.swift | ||
// | ||
// | ||
// Created by Nityananda Zbil on 29.02.24. | ||
// | ||
|
||
// Alias for the most recent schema | ||
|
||
typealias ServerModel = SchemaV1.Server | ||
typealias CourseModel = SchemaV1.Course | ||
typealias ConversationModel = SchemaV1.Conversation | ||
typealias MessageModel = SchemaV1.Message |
Oops, something went wrong.