Skip to content

Commit

Permalink
fix(messages): ensure IE10Compatible applied to all Messages
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyeh committed May 4, 2018
1 parent 048f469 commit 3440838
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
3 changes: 2 additions & 1 deletion plugins/typed-messages/src/audio-message.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FileMessage from './file-message';
import { messageType } from './realtime';
import { messageType, IE10Compatible } from './realtime';

/**
* 构造方法参数同 {@link FileMessage}
Expand All @@ -17,5 +17,6 @@ AudioMessage._summaryType = '语音';
* @const
*/
messageType(-3)(AudioMessage);
IE10Compatible(AudioMessage);

export default AudioMessage;
8 changes: 7 additions & 1 deletion plugins/typed-messages/src/file-message.js
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down Expand Up @@ -88,3 +93,4 @@ FileMessage._summaryType = '文件';
*/
messageType(-6)(FileMessage);
messageField('_lcfile')(FileMessage);
IE10Compatible(FileMessage);
3 changes: 2 additions & 1 deletion plugins/typed-messages/src/image-message.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FileMessage from './file-message';
import { messageType } from './realtime';
import { messageType, IE10Compatible } from './realtime';

/**
* 构造方法参数同 {@link FileMessage}
Expand All @@ -17,5 +17,6 @@ ImageMessage._summaryType = '图片';
* @const
*/
messageType(-2)(ImageMessage);
IE10Compatible(ImageMessage);

export default ImageMessage;
8 changes: 7 additions & 1 deletion plugins/typed-messages/src/location-message.js
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down Expand Up @@ -56,3 +61,4 @@ export default class LocationMessage extends TypedMessage {
*/
messageType(-5)(LocationMessage);
messageField('_lcloc')(LocationMessage);
IE10Compatible(LocationMessage);
7 changes: 6 additions & 1 deletion plugins/typed-messages/src/realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
3 changes: 2 additions & 1 deletion plugins/typed-messages/src/video-message.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FileMessage from './file-message';
import { messageType } from './realtime';
import { messageType, IE10Compatible } from './realtime';

/**
* 构造方法参数同 {@link FileMessage}
Expand All @@ -17,5 +17,6 @@ VideoMessage._summaryType = '视频';
* @const
*/
messageType(-4)(VideoMessage);
IE10Compatible(VideoMessage);

export default VideoMessage;
5 changes: 4 additions & 1 deletion src/messages/binary-message.js
Original file line number Diff line number Diff line change
@@ -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 {
/**
* 二进制消息
Expand Down
3 changes: 2 additions & 1 deletion src/messages/recalled-message.js
Original file line number Diff line number Diff line change
@@ -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 会使用该类型的消息替代原始消息
Expand Down

0 comments on commit 3440838

Please sign in to comment.