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:
@ -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();
|
||||
|
||||
|
@ -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}");
|
||||
}
|
||||
|
Reference in New Issue
Block a user