-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMessage.swift
64 lines (56 loc) · 1.27 KB
/
Message.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Message.swift
// chatWithFBAppSample
//
// Created by anies1212 on 2022/03/23.
//
import Foundation
import MessageKit
import CoreLocation
struct Message: MessageType {
public var sender: SenderType
public var messageId: String
public var sentDate: Date
public var kind: MessageKind
}
extension MessageKind{
var messageKindString : String {
switch self {
case .text(_):
return "text"
case .attributedText(_):
return "attributedText"
case .photo(_):
return "photo"
case .video(_):
return "video"
case .location(_):
return "location"
case .emoji(_):
return "emoji"
case .audio(_):
return "audio"
case .contact(_):
return "contact"
case .linkPreview(_):
return "linkPreview"
case .custom(_):
return "custom"
}
}
}
struct Media: MediaItem {
var url: URL?
var image: UIImage?
var placeholderImage: UIImage
var size: CGSize
}
struct Sender: SenderType{
public var senderId: String
public var displayName: String
public var photoURL: String
}
struct Location : LocationItem {
var location: CLLocation
var size: CGSize
}