Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.0

- BREAKING CHANGE: Changed the `notify` property of the `Participant` to allow for mentions only

## 0.3.1

- Added explicit support for Android and iOS in pubspec.yaml
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chatbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class ChatBoxState extends State<ChatBox> {
}

if (participant.notify != null) {
result['notify'] = participant.notify;
result['notify'] = participant.notify!.getValue();
}

execute('$variableName.setParticipant($userVariableName, ${json.encode(result)});');
Expand Down
19 changes: 18 additions & 1 deletion lib/src/conversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,30 @@ extension ParticipantAccessString on ParticipantAccess {
}
}

/// Possible values for participants' notifications
enum ParticipantNotification { off, on, mentionsOnly }

extension ParticipantNotificationString on ParticipantNotification {
/// Converts this enum's values to String.
dynamic getValue() {
switch (this) {
case ParticipantNotification.off:
return false;
case ParticipantNotification.on:
return true;
case ParticipantNotification.mentionsOnly:
return 'MentionsOnly';
}
}
}

// Participants are users + options relative to this conversation
class Participant {
final User user;

final ParticipantAccess? access;

final bool? notify;
final ParticipantNotification? notify;

const Participant(this.user, {this.access, this.notify});

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: talkjs_flutter
description: Official TalkJS SDK for Flutter
version: 0.3.1
version: 0.4.0
homepage: https://talkjs.com

environment:
Expand Down