-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/implement message poll #212
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:mineral/api.dart'; | ||
import 'package:mineral/src/domains/events/event.dart'; | ||
import 'package:mineral/src/domains/events/types/listenable_event.dart'; | ||
|
||
typedef PrivatePollVoteAddEventHandler = FutureOr<void> Function( | ||
PrivateMessage, Member, int); | ||
|
||
abstract class PrivatePollVoteAddEvent implements ListenableEvent { | ||
@override | ||
Event get event => Event.privatePollVoteAdd; | ||
|
||
@override | ||
String? customId; | ||
|
||
FutureOr<void> handle(PrivateMessage message, User user, int answer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't give directly PollAnswer object instead of int ? |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:mineral/api.dart'; | ||
import 'package:mineral/src/domains/events/event.dart'; | ||
import 'package:mineral/src/domains/events/types/listenable_event.dart'; | ||
|
||
typedef PrivatePollVoteRemoveEventHandler = FutureOr<void> Function( | ||
PrivateMessage, Member, int); | ||
|
||
abstract class PrivatePollVoteRemoveEvent implements ListenableEvent { | ||
@override | ||
Event get event => Event.privatePollVoteRemove; | ||
|
||
@override | ||
String? customId; | ||
|
||
FutureOr<void> handle(PrivateMessage message, User user, int answer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:mineral/api.dart'; | ||
import 'package:mineral/src/domains/events/event.dart'; | ||
import 'package:mineral/src/domains/events/types/listenable_event.dart'; | ||
|
||
typedef ServerPollVoteAddEventHandler = FutureOr<void> Function( | ||
ServerMessage, Member, int); | ||
|
||
abstract class ServerPollVoteAddEvent implements ListenableEvent { | ||
@override | ||
Event get event => Event.serverPollVoteAdd; | ||
|
||
@override | ||
String? customId; | ||
|
||
FutureOr<void> handle(ServerMessage message, Member member, int answer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:mineral/api.dart'; | ||
import 'package:mineral/src/domains/events/event.dart'; | ||
import 'package:mineral/src/domains/events/types/listenable_event.dart'; | ||
|
||
typedef ServerPollVoteRemoveEventHandler = FutureOr<void> Function( | ||
ServerMessage, Member, int); | ||
|
||
abstract class ServerPollVoteRemoveEvent implements ListenableEvent { | ||
@override | ||
Event get event => Event.serverPollVoteRemove; | ||
|
||
@override | ||
String? customId; | ||
|
||
FutureOr<void> handle(ServerMessage message, Member member, int answer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import 'package:mineral/src/domains/events/contracts/private/private_channel_pin | |
import 'package:mineral/src/domains/events/contracts/private/private_channel_update_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_dialog_submit_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_message_create_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_poll_vote_add_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_poll_vote_remove_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_text_select_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/private/private_user_select_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_ban_add_event.dart'; | ||
|
@@ -26,6 +28,8 @@ import 'package:mineral/src/domains/events/contracts/server/server_member_remove | |
import 'package:mineral/src/domains/events/contracts/server/server_member_select_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_member_update_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_message_create_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_poll_vote_add_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_poll_vote_remove_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_presence_update_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_role_select_event.dart'; | ||
import 'package:mineral/src/domains/events/contracts/server/server_roles_create_event.dart'; | ||
|
@@ -98,6 +102,10 @@ enum Event implements EnhancedEnum, EventType { | |
['ThreadChannel thread', 'Server server', 'Member member']), | ||
serverThreadListSync(ServerThreadListSyncEvent, | ||
['List<ThreadChannel> threads', 'Server server']), | ||
serverPollVoteAdd(ServerPollVoteAddEvent, | ||
['ServerMessage message', 'Member member', 'String answer']), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You give as a "String answer", but you give really as int |
||
serverPollVoteRemove(ServerPollVoteRemoveEvent, | ||
['ServerMessage message', 'Member member', 'String answer']), | ||
|
||
// private | ||
privateMessageCreate(PrivateMessageCreateEvent, ['PrivateMessage message']), | ||
|
@@ -111,7 +119,10 @@ enum Event implements EnhancedEnum, EventType { | |
PrivateUserSelectEvent, ['PrivateSelectContext ctx', 'List<User> users']), | ||
privateTextSelect(PrivateTextSelectEvent, | ||
['PrivateSelectContext ctx', 'List<String> values']), | ||
; | ||
privatePollVoteAdd(PrivatePollVoteAddEvent, | ||
['PrivateMessage message', 'User user', 'String answer']), | ||
privatePollVoteRemove(PrivatePollVoteRemoveEvent, | ||
['PrivateMessage message', 'User user', 'String answer']); | ||
|
||
@override | ||
final Type value; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove server update event export ?