Huge refactor to add better structure to the project. Separating features with their associated view and model structure. This should be better organization and will allow us to improve the overall architecture in the future. I forsee many more improvements that can follow this change. e.g. MVVM Arch As well as cleaning up duplicate, unused, functionality. Many files have global functions that can also be moved or be renamed. damus/ ├── Features/ │ ├── <Feature>/ │ │ ├── Views/ │ │ └── Models/ ├── Shared/ │ ├── Components/ │ ├── Media/ │ ├── Buttons/ │ ├── Extensions/ │ ├── Empty Views/ │ ├── ErrorHandling/ │ ├── Modifiers/ │ └── Utilities/ ├── Core/ │ ├── Nostr/ │ ├── NIPs/ │ ├── DIPs/ │ ├── Types/ │ ├── Networking/ │ └── Storage/ Signed-off-by: ericholguin <ericholguin@apache.org>
37 lines
682 B
Swift
37 lines
682 B
Swift
//
|
||
// MakeZapRequest.swift
|
||
// damus
|
||
//
|
||
// Created by Daniel D’Aquino on 2023-11-27.
|
||
//
|
||
|
||
import Foundation
|
||
|
||
enum MakeZapRequest {
|
||
case priv(ZapRequest, PrivateZapRequest)
|
||
case normal(ZapRequest)
|
||
|
||
var private_inner_request: ZapRequest {
|
||
switch self {
|
||
case .priv(_, let pzr):
|
||
return pzr.req
|
||
case .normal(let zr):
|
||
return zr
|
||
}
|
||
}
|
||
|
||
var potentially_anon_outer_request: ZapRequest {
|
||
switch self {
|
||
case .priv(let zr, _):
|
||
return zr
|
||
case .normal(let zr):
|
||
return zr
|
||
}
|
||
}
|
||
}
|
||
|
||
struct PrivateZapRequest {
|
||
let req: ZapRequest
|
||
let enc: String
|
||
}
|