From 344083857aefce8e9aa736dd4be03adfabaf07a3 Mon Sep 17 00:00:00 2001 From: leeyeh Date: Fri, 4 May 2018 18:07:32 +0800 Subject: [PATCH] fix(messages): ensure IE10Compatible applied to all Messages fixes #594 --- plugins/typed-messages/src/audio-message.js | 3 ++- plugins/typed-messages/src/file-message.js | 8 +++++++- plugins/typed-messages/src/image-message.js | 3 ++- plugins/typed-messages/src/location-message.js | 8 +++++++- plugins/typed-messages/src/realtime.js | 7 ++++++- plugins/typed-messages/src/video-message.js | 3 ++- src/messages/binary-message.js | 5 ++++- src/messages/recalled-message.js | 3 ++- 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/plugins/typed-messages/src/audio-message.js b/plugins/typed-messages/src/audio-message.js index 40de26f36..2e034be52 100644 --- a/plugins/typed-messages/src/audio-message.js +++ b/plugins/typed-messages/src/audio-message.js @@ -1,5 +1,5 @@ import FileMessage from './file-message'; -import { messageType } from './realtime'; +import { messageType, IE10Compatible } from './realtime'; /** * 构造方法参数同 {@link FileMessage} @@ -17,5 +17,6 @@ AudioMessage._summaryType = '语音'; * @const */ messageType(-3)(AudioMessage); +IE10Compatible(AudioMessage); export default AudioMessage; diff --git a/plugins/typed-messages/src/file-message.js b/plugins/typed-messages/src/file-message.js index e7e9644dc..cf7e82d09 100644 --- a/plugins/typed-messages/src/file-message.js +++ b/plugins/typed-messages/src/file-message.js @@ -1,5 +1,10 @@ import { File } from './storage'; -import { TypedMessage, messageType, messageField } from './realtime'; +import { + TypedMessage, + messageType, + messageField, + IE10Compatible, +} from './realtime'; export default class FileMessage extends TypedMessage { /** @@ -88,3 +93,4 @@ FileMessage._summaryType = '文件'; */ messageType(-6)(FileMessage); messageField('_lcfile')(FileMessage); +IE10Compatible(FileMessage); diff --git a/plugins/typed-messages/src/image-message.js b/plugins/typed-messages/src/image-message.js index cb6485ae5..dd6d1bd93 100644 --- a/plugins/typed-messages/src/image-message.js +++ b/plugins/typed-messages/src/image-message.js @@ -1,5 +1,5 @@ import FileMessage from './file-message'; -import { messageType } from './realtime'; +import { messageType, IE10Compatible } from './realtime'; /** * 构造方法参数同 {@link FileMessage} @@ -17,5 +17,6 @@ ImageMessage._summaryType = '图片'; * @const */ messageType(-2)(ImageMessage); +IE10Compatible(ImageMessage); export default ImageMessage; diff --git a/plugins/typed-messages/src/location-message.js b/plugins/typed-messages/src/location-message.js index 79aca1092..fb22e2f93 100644 --- a/plugins/typed-messages/src/location-message.js +++ b/plugins/typed-messages/src/location-message.js @@ -1,5 +1,10 @@ import { GeoPoint } from './storage'; -import { TypedMessage, messageType, messageField } from './realtime'; +import { + TypedMessage, + messageType, + messageField, + IE10Compatible, +} from './realtime'; export default class LocationMessage extends TypedMessage { /** @@ -56,3 +61,4 @@ export default class LocationMessage extends TypedMessage { */ messageType(-5)(LocationMessage); messageField('_lcloc')(LocationMessage); +IE10Compatible(LocationMessage); diff --git a/plugins/typed-messages/src/realtime.js b/plugins/typed-messages/src/realtime.js index a91a7ae7d..619e908ab 100644 --- a/plugins/typed-messages/src/realtime.js +++ b/plugins/typed-messages/src/realtime.js @@ -5,4 +5,9 @@ if (!TypedMessage) { throw new Error('LeanCloud Realtime SDK not installed'); } -export { TypedMessage, messageType, messageField } from 'leancloud-realtime'; +export { + TypedMessage, + messageType, + messageField, + IE10Compatible, +} from 'leancloud-realtime'; diff --git a/plugins/typed-messages/src/video-message.js b/plugins/typed-messages/src/video-message.js index d600b04e9..3b2e75b4b 100644 --- a/plugins/typed-messages/src/video-message.js +++ b/plugins/typed-messages/src/video-message.js @@ -1,5 +1,5 @@ import FileMessage from './file-message'; -import { messageType } from './realtime'; +import { messageType, IE10Compatible } from './realtime'; /** * 构造方法参数同 {@link FileMessage} @@ -17,5 +17,6 @@ VideoMessage._summaryType = '视频'; * @const */ messageType(-4)(VideoMessage); +IE10Compatible(VideoMessage); export default VideoMessage; diff --git a/src/messages/binary-message.js b/src/messages/binary-message.js index 5d7823f39..f481e8f71 100644 --- a/src/messages/binary-message.js +++ b/src/messages/binary-message.js @@ -1,6 +1,9 @@ import { encode as encodeBase64 } from 'base64-arraybuffer'; import Message from './message'; - +import { IE10Compatible } from './helpers'; +// jsdoc-ignore-start +@IE10Compatible +// jsdoc-ignore-end export default class BinaryMessage extends Message { /** * 二进制消息 diff --git a/src/messages/recalled-message.js b/src/messages/recalled-message.js index a0c101d62..c25915a6d 100644 --- a/src/messages/recalled-message.js +++ b/src/messages/recalled-message.js @@ -1,8 +1,9 @@ import TypedMessage from './typed-message'; -import { messageType } from './helpers'; +import { messageType, IE10Compatible } from './helpers'; // jsdoc-ignore-start @messageType(-127) +@IE10Compatible // jsdoc-ignore-end /** * 已撤回类型消息,当消息被撤回时,SDK 会使用该类型的消息替代原始消息