Skip to content

Commit

Permalink
Release 3.0.10 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
intoxicated committed Apr 22, 2021
1 parent a420cc6 commit ddcfd68
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 109 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [3.0.10] - Apr 19, 2021
* Fixed register token endpoint
* Fixed typo
* Dropped some suffix `~Filter` from `GroupChannelListQuery`
* Changed `FileInfo.fromUrl` parameter `mimeType` as optional (default is `image/jpeg`)
* Changed `getCurrentUser` to `currentUser` getter
* Improved stability

## [3.0.9]
* Fixed metaData mapping for `User`
* Renamed `ImageInfo` to `FileInfo`
Expand Down
15 changes: 9 additions & 6 deletions lib/constant/contants.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// extension sdk version
const String SbExtensionKeyUIKit = 'sb_uikit';
const String SbExtensionKeySyncManager = 'sb_syncmanager';
const String sbExtensionKeyUIKit = 'sb_uikit';
const String sbExtensionKeySyncManager = 'sb_syncmanager';

const String SbExtraDataPremiumFeatureList = 'premium_feature_list';
const String SbExtraDataFileUploadSizeLimit = 'file_upload_size_limit';
const String SbExtraDataEmojiHash = 'emoji_hash';
const String SbExtraDataApplicationAttributes = 'application_attributes';
const String sbExtraDataPremiumFeatureList = 'premium_feature_list';
const String sbExtraDataFileUploadSizeLimit = 'file_upload_size_limit';
const String sbExtraDataEmojiHash = 'emoji_hash';
const String sbExtraDataApplicationAttributes = 'application_attributes';

const String sbPushTemplateDefault = 'default';
const String sbPushTemplateAlternative = 'alternative';
2 changes: 1 addition & 1 deletion lib/core/channel/base/base_channel_meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ extension Meta on BaseChannel {
return BaseMessage.msgFromJson(result.payload);
}

/// Removes list of [metaArrays] with given [message]
/// Removes values from list of [metaArrays] with given [message]
Future<BaseMessage> removeMessageMetaArray(
BaseMessage message,
List<MessageMetaArray> metaArrays,
Expand Down
2 changes: 1 addition & 1 deletion lib/core/channel/group/group_channel_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension GroupChannelInternal on GroupChannel {
bool updateUnreadCount(BaseMessage message) {
if (message == null) return false;

final currentUser = SendbirdSdk().getCurrentUser();
final currentUser = SendbirdSdk().currentUser;

if (!message.isSilent) {
if (!message.sender.isCurrentUser) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/message/base_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class BaseMessage {

/// Retrieves threaded messages (replies) on this message with [timestamp]
/// and [params].
Future<ThreadedMessageResponse> getThreadedMessageByTimestamp(
Future<ThreadedMessageResponse> getThreadedMessagesByTimestamp(
int timestamp,
ThreadedMessageListParams params,
) async {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/models/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class User {
metaData.removeWhere((key, value) => true);
}

bool get isCurrentUser => userId == SendbirdSdk().getCurrentUser()?.userId;
bool get isCurrentUser => userId == SendbirdSdk().currentUser?.userId;

// json serialization

Expand Down
8 changes: 4 additions & 4 deletions lib/managers/command_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class CommandManager with SdkAccessor {
logger.e('sendCommand: command parameter is null');
throw InvalidParameterError();
}
if (!webSocket.isConnected()) {
logger.e('sendCommand: Websocket connection is closed');
throw WebSocketConnectionClosedError();
}
// if (!webSocket.isConnected()) {
// logger.e('sendCommand: Websocket connection is closed');
// throw WebSocketConnectionClosedError();
// }

try {
await ConnectionManager.readyToExecuteWSRequest();
Expand Down
6 changes: 3 additions & 3 deletions lib/params/file_message_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class FileMessageParams extends BaseMessageParams {
}

FileMessageParams.withUrl(
String fileUrl,
String mimeType, {
String fileUrl, {
String mimeType,
int size,
String name,
FileMessage fileMessage,
}) : super.withMessage(fileMessage, deepCopy: false) {
uploadFile = FileInfo.fromUrl(
name: name ?? 'image',
mimeType: mimeType,
mimeType: mimeType ?? 'image/jpeg',
url: fileUrl,
fileSize: size,
);
Expand Down
17 changes: 13 additions & 4 deletions lib/query/application_user_list_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ part of 'user_list_query.dart';
/// A query object to retrieve list of user on current application.
@JsonSerializable()
class ApplicationUserListQuery extends UserListQuery {
/// The meta data key filter. This query will return users
/// that has the meta data key and values
/// Filters users who have this meta data key.
///
/// This query will return users that has the meta data key and values
/// This should be specified in conjunction with the metaDataValues.
String metaDataKey;

/// The meta data values filter. This query will return users
/// that has the meta data key and values
/// Filters users who have this meta data values.
///
/// This query will return users that has the meta data key and values
/// This should be specified in conjunction with the metaDataKey.
List<String> metaDataValues;

/// Filters users whose nicknames start with the this value
String nicknameStartsWith;

ApplicationUserListQuery({
this.metaDataKey,
this.metaDataValues,
this.nicknameStartsWith,
}) : super(queryType: UserListQueryType.filtered);

@override
Expand All @@ -29,6 +37,7 @@ class ApplicationUserListQuery extends UserListQuery {
userIds: userIds,
metaDataKey: metaDataKey,
metaDataValues: metaDataValues,
nicknameStartsWith: nicknameStartsWith,
);

loading = false;
Expand Down
72 changes: 36 additions & 36 deletions lib/query/group_channel_list_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,44 +32,44 @@ class GroupChannelListQuery extends QueryBase {
/// Sets to filter public channel. Default is `all`
PublicChannelFilter publicChannelFilter;

/// Sets to filter channels by the unread messages.
/// The default value is `all`
UnreadChannelFilter unreadChannelFilter;

/// Sets to filter channels by the hidden state.
/// The default value is `unhiddenOnly`
ChannelHiddenStateFilter channelHiddenStateFilter;

/// Sets to filter channels by custom type that starts with
String customTypeStartWithFilter;
String customTypeStartWith;

/// Sets the custom type filter.
List<String> customTypesFilter;
List<String> customTypes;

/// Sets the filter with nickname.
///
/// Query result will contains
/// channels that any one of member contains given nickname
String nicknameContainsFilter;
String nicknameContains;

/// Sets the filter with user IDs
///
/// Query result will return if any one of user id matches with channel's members
List<String> userIdsIncludeFilter;
List<String> userIdsIncludeIn;

/// Sets the filter with user IDs
///
/// Query result will return only if channel's members are exactly matched
/// with this property
List<String> userIdsExactFilter;
List<String> userIdsExactlyIn;

/// Sets a filter to return only channels that contains the
/// specified group channel name
String channelNameContainsFilter;

/// Sets to filter channels by the unread messages.
/// The default value is `all`
UnreadChannelFilter unreadChannelFilter;
String channelNameContains;

/// Sets a key for ordering by value in the metadata.
/// This is valid when the `order` is `channelMetaDataValueAlphabetical` only
String metaDataOrderKeyFilter;

/// Sets to filter channels by the hidden state.
/// The default value is `unhiddenOnly`
ChannelHiddenStateFilter channelHiddenStateFilter;
String metaDataOrderKey;

String searchQuery;
List<GroupChannelListQuerySearchField> searchFields;
Expand All @@ -86,31 +86,31 @@ class GroupChannelListQuery extends QueryBase {
/// default value is `true`
bool includeMemberList = true;

// Query result of channel object contains meta data if `true`.
// deault value is `false`
/// Query result of channel object contains meta data if `true`.
/// deault value is `false`
bool includeMetaData = true;

GroupChannelListQuery();

void setUserIdsExactFilter(List<String> userIds) {
nicknameContainsFilter = null;
userIdsIncludeFilter = null;
userIdsExactFilter = userIds;
nicknameContains = null;
userIdsIncludeIn = null;
userIdsExactlyIn = userIds;
queryType = GroupChannelListQueryType.and;
}

void setUserIdsIncludeFilter(
List<String> userIds, GroupChannelListQueryType type) {
nicknameContainsFilter = null;
userIdsExactFilter = null;
userIdsIncludeFilter = userIds;
nicknameContains = null;
userIdsExactlyIn = null;
userIdsIncludeIn = userIds;
queryType = type;
}

void setNicknameContainsFilter(String nickname) {
userIdsIncludeFilter = null;
userIdsExactFilter = null;
nicknameContainsFilter = nickname;
userIdsIncludeIn = null;
userIdsExactlyIn = null;
nicknameContains = nickname;
}

void setSearchFilter(
Expand All @@ -120,11 +120,11 @@ class GroupChannelListQuery extends QueryBase {
}

void setChannelUrlsFilter(List<String> channelUrls) {
userIdsExactFilter = null;
userIdsIncludeFilter = null;
userIdsExactlyIn = null;
userIdsIncludeIn = null;
searchFields = null;
searchQuery = null;
nicknameContainsFilter = null;
nicknameContains = null;
channelUrls = channelUrls;
}

Expand All @@ -145,17 +145,17 @@ class GroupChannelListQuery extends QueryBase {
];

final filter = GroupChannelFilter()
..customTypeStartswith = customTypeStartWithFilter
..customTypes = customTypesFilter
..customTypeStartswith = customTypeStartWith
..customTypes = customTypes
..memberStateFilter = memberStateFilter
..membersExactlyIn = userIdsExactFilter
..membersIncludeIn = userIdsIncludeFilter
..membersNicknameContains = nicknameContainsFilter
..nameContains = channelNameContainsFilter
..membersExactlyIn = userIdsExactlyIn
..membersIncludeIn = userIdsIncludeIn
..membersNicknameContains = nicknameContains
..nameContains = channelNameContains
..superMode = superChannelFilter
..publicMode = publicChannelFilter
..unreadFilter = unreadChannelFilter
..metadataOrderKey = metaDataOrderKeyFilter
..metadataOrderKey = metaDataOrderKey
..hiddenMode = channelHiddenStateFilter;

final sdk = SendbirdSdk().getInternal();
Expand Down
37 changes: 17 additions & 20 deletions lib/query/group_channel_list_query.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions lib/sdk/internal/sendbird_sdk_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'package:sendbird_sdk/utils/async/async_queue.dart';
import 'package:sendbird_sdk/utils/logger.dart';
import 'package:sendbird_sdk/utils/parsers.dart';

const sdk_version = '3.0.9';
const sdk_version = '3.0.10';
const platform = 'flatter';
const platform_version = '1.22.5';

Expand All @@ -51,10 +51,10 @@ class SendbirdSdkInternal with WidgetsBindingObserver {
AsyncQueue _commandQueue = AsyncQueue<String>();
Map<String, String> _extensions = {};
List<String> _extraDatas = [
Constants.SbExtraDataPremiumFeatureList,
Constants.SbExtraDataFileUploadSizeLimit,
Constants.SbExtraDataApplicationAttributes,
Constants.SbExtraDataEmojiHash,
Constants.sbExtraDataPremiumFeatureList,
Constants.sbExtraDataFileUploadSizeLimit,
Constants.sbExtraDataApplicationAttributes,
Constants.sbExtraDataEmojiHash,
];

//should only keep one instance
Expand Down Expand Up @@ -330,7 +330,7 @@ class SendbirdSdkInternal with WidgetsBindingObserver {
_state.connected = false;
_state.connecting = false;
_state.reconnecting = false;
_webSocket.close();
_webSocket?.close();
}

_handleEnterForeground() async {
Expand Down Expand Up @@ -369,16 +369,16 @@ class SendbirdSdkInternal with WidgetsBindingObserver {
}

String get _sbUserAgent {
final uikitVersion = _extensions[Constants.SbExtensionKeyUIKit];
final uikitVersion = _extensions[Constants.sbExtensionKeyUIKit];
final core = '/c$sdk_version';
final uikit = uikitVersion != null ? '/u$uikitVersion' : '';
final os = '/o${Platform.operatingSystem.toLowerCase()}';
return '$platform$core$uikit$os';
}

void addVersionExtension(String key, String version) {
if (key != Constants.SbExtensionKeyUIKit ||
key != Constants.SbExtensionKeySyncManager) {
if (key != Constants.sbExtensionKeyUIKit ||
key != Constants.sbExtensionKeySyncManager) {
return;
}
_extensions[key] = version;
Expand Down
Loading

0 comments on commit ddcfd68

Please sign in to comment.