Skip to content

Commit

Permalink
Set Rest.{Message, PresenceMessage} directly in the class
Browse files Browse the repository at this point in the history
Less code, and consistent with Realtime.
  • Loading branch information
lawrence-forooghian committed May 9, 2023
1 parent b79fba5 commit bb480b0
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/common/lib/client/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ class Rest {
static Callbacks = Rest;
static Platform = Platform;
static Crypto?: typeof Platform.Crypto;
static Message?: typeof Message;
static PresenceMessage?: typeof PresenceMessage;
static Message = Message;
static PresenceMessage = PresenceMessage;
}

class Channels {
Expand Down
6 changes: 0 additions & 6 deletions src/platform/nativescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { getDefaults } from '../../common/lib/util/defaults';
import WebStorage from './lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -31,10 +29,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;

Rest.PresenceMessage = PresenceMessage;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
6 changes: 0 additions & 6 deletions src/platform/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import Transports from './lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import PlatformDefaults from './lib/util/defaults';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -27,10 +25,6 @@ Platform.WebStorage = null;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;

Rest.PresenceMessage = PresenceMessage;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
6 changes: 0 additions & 6 deletions src/platform/react-native/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { getDefaults } from '../../common/lib/util/defaults';
import WebStorage from '../web/lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -29,10 +27,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;

Rest.PresenceMessage = PresenceMessage;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
6 changes: 0 additions & 6 deletions src/platform/web-noencryption/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { getDefaults } from '../../common/lib/util/defaults';
import WebStorage from '../web/lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = null;
Platform.BufferUtils = BufferUtils;
Expand All @@ -28,10 +26,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;

Rest.PresenceMessage = PresenceMessage;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
6 changes: 0 additions & 6 deletions src/platform/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { getDefaults } from '../../common/lib/util/defaults';
import WebStorage from './lib/util/webstorage';
import PlatformDefaults from './lib/util/defaults';
import msgpack from './lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -29,10 +27,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;

Rest.PresenceMessage = PresenceMessage;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down

0 comments on commit bb480b0

Please sign in to comment.