Fix message deletion

pull/46/head
Niels Andriesse 6 years ago
parent 85fe0504b2
commit 462c61d38f

@ -42,7 +42,7 @@ struct MessageActionBuilder {
static func deleteMessage(conversationViewItem: ConversationViewItem, delegate: MessageActionsDelegate) -> MenuAction { static func deleteMessage(conversationViewItem: ConversationViewItem, delegate: MessageActionsDelegate) -> MenuAction {
return MenuAction(image: #imageLiteral(resourceName: "ic_trash"), return MenuAction(image: #imageLiteral(resourceName: "ic_trash"),
title: NSLocalizedString("MESSAGE_ACTION_DELETE_MESSAGE", comment: "Action sheet button title"), title: NSLocalizedString("MESSAGE_ACTION_DELETE_MESSAGE", comment: "Action sheet button title"),
subtitle: NSLocalizedString("MESSAGE_ACTION_DELETE_MESSAGE_SUBTITLE", comment: "Action sheet button subtitle"), subtitle: nil,
block: { (_) in block: { (_) in
conversationViewItem.deleteAction() conversationViewItem.deleteAction()
}) })

@ -1186,7 +1186,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
// Delete the message // Delete the message
BOOL isSentByUser = (interationType == OWSInteractionType_OutgoingMessage); BOOL isSentByUser = (interationType == OWSInteractionType_OutgoingMessage);
[[LKGroupChatAPI deleteMessageWithID:message.isGroupChatMessage forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer isSentByUser:isSentByUser].catch(^(NSError *error) { [[LKGroupChatAPI deleteMessageWithID:message.groupChatMessageID forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer isSentByUser:isSentByUser].catch(^(NSError *error) {
// Roll back // Roll back
[self.interaction save]; [self.interaction save];
}) retainUntilComplete]; }) retainUntilComplete];

Loading…
Cancel
Save