mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-14 15:26:40 +10:00
Fix logic for send state
This commit is contained in:
@@ -1534,7 +1534,6 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi
|
||||
|
||||
updateMessageReadStatesChangeOperation()
|
||||
|
||||
|
||||
case MessageStateOperationType.Sent.rawValue:
|
||||
// println("Message Sent")
|
||||
removeSendStates()
|
||||
@@ -1630,6 +1629,7 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi
|
||||
self.realm.beginWrite()
|
||||
if let sendState = sendStates.last {
|
||||
sendState.sendState = MessageSendState.Read.rawValue
|
||||
message.sendState = MessageSendState.Read.rawValue
|
||||
sendState.updatedAt = NSDate()
|
||||
}
|
||||
self.realm.commitWrite()
|
||||
@@ -1642,6 +1642,8 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi
|
||||
|
||||
if let cell = conversationCollectionView.cellForItemAtIndexPath(indexPath) as? ChatStateCell {
|
||||
|
||||
println("Config Chat State Cell \(cell.stateLabel.text)")
|
||||
|
||||
configChatStateWithMessage(message, cell: cell)
|
||||
|
||||
} else {
|
||||
@@ -1667,6 +1669,8 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi
|
||||
} else {
|
||||
cell.stateLabel.text = "\(MessageSendState(rawValue: message.sendState)!.description) \(sectionDateFormatter.stringFromDate(message.updatedAt))"
|
||||
}
|
||||
|
||||
cell.setNeedsDisplay()
|
||||
}
|
||||
|
||||
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
|
||||
|
||||
Reference in New Issue
Block a user