1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Handles comment deletion events

This commit is contained in:
2020-04-18 16:57:00 +02:00
parent 6b08b62832
commit dab4e7bde1
4 changed files with 22 additions and 5 deletions

View File

@ -38,6 +38,14 @@ class UpdatedCommentEvent {
UpdatedCommentEvent(this.comment);
}
/// Deleted comment
class DeletedCommentEvent {
final int commentID;
DeletedCommentEvent(this.commentID);
}
class EventsHelper {
static EventBus _mgr = EventBus();

View File

@ -132,6 +132,11 @@ class WebSocketHelper {
UpdatedCommentEvent(CommentsHelper.apiToComment(msg.data)));
break;
// Deleted comment
case "comment_deleted":
EventsHelper.emit(DeletedCommentEvent(msg.data));
break;
default:
throw Exception("Unknown message type: ${msg.title}");
}