@@ -100,19 +100,21 @@ extension ChatView {
100
100
let nextMessageIsSameUser = nextMessage? . user. id == message. user. id
101
101
let prevMessageIsSameUser = prevMessage? . user. id == message. user. id
102
102
103
- let position : PositionInUserGroup
103
+ let positionInUserGroup : PositionInUserGroup
104
104
if nextMessageExists, nextMessageIsSameUser, prevMessageIsSameUser {
105
- position = . middle
105
+ positionInUserGroup = . middle
106
106
} else if !nextMessageExists || !nextMessageIsSameUser, !prevMessageIsSameUser {
107
- position = . single
107
+ positionInUserGroup = . single
108
108
} else if nextMessageExists, nextMessageIsSameUser {
109
- position = . first
109
+ positionInUserGroup = . first
110
110
} else {
111
- position = . last
111
+ positionInUserGroup = . last
112
112
}
113
113
114
114
if replyMode == . quote {
115
- return MessageRow ( message: $0. element, positionInUserGroup: position, commentsPosition: nil )
115
+ return MessageRow (
116
+ message: $0. element, positionInUserGroup: positionInUserGroup,
117
+ commentsPosition: nil )
116
118
}
117
119
118
120
let nextMessageIsAReply = nextMessage? . replyMessage != nil
@@ -156,9 +158,13 @@ extension ChatView {
156
158
positionInChat = . middle
157
159
}
158
160
159
- let commentsPosition = CommentsPosition ( inCommentsGroup: positionInComments, inSection: positionInSection, inChat: positionInChat)
161
+ let commentsPosition = CommentsPosition (
162
+ inCommentsGroup: positionInComments, inSection: positionInSection,
163
+ inChat: positionInChat)
160
164
161
- return MessageRow ( message: $0. element, positionInUserGroup: position, commentsPosition: commentsPosition)
165
+ return MessageRow (
166
+ message: $0. element, positionInUserGroup: positionInUserGroup,
167
+ commentsPosition: commentsPosition)
162
168
}
163
169
. reversed ( )
164
170
}
0 commit comments