Skip to content

Commit

Permalink
Remove deprecated RealtimePresence.on/off methods
Browse files Browse the repository at this point in the history
Part of #1197.
  • Loading branch information
lawrence-forooghian committed Apr 27, 2023
1 parent ba830e7 commit 486e958
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
12 changes: 0 additions & 12 deletions src/common/lib/client/realtimepresence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,18 +507,6 @@ class RealtimePresence extends Presence {
});
}

/* Deprecated */
on(...args: unknown[]): void {
Logger.deprecated('presence.on', 'presence.subscribe');
this.subscribe(...args);
}

/* Deprecated */
off(...args: unknown[]): void {
Logger.deprecated('presence.off', 'presence.unsubscribe');
this.unsubscribe(...args);
}

subscribe(..._args: unknown[] /* [event], listener, [callback] */): void | Promise<void> {
const args = RealtimeChannel.processListenerArgs(_args);
const event = args[0];
Expand Down
33 changes: 0 additions & 33 deletions test/realtime/presence.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,39 +1118,6 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, helper, async
});
});

/*
* Check that old deprecated on/off methods still work
*/
it('presenceOn', function (done) {
var channelName = 'enterOn';
var testData = 'some data';
var eventListener = function (channel, callback) {
var presenceHandler = function () {
callback();
};
channel.presence.on(presenceHandler);
};
var enterOn = function (cb) {
var clientRealtime = helper.AblyRealtime({ clientId: testClientId, tokenDetails: authToken });
clientRealtime.connection.on('connected', function () {
/* get channel, attach, and enter */
var clientChannel = clientRealtime.channels.get(channelName);
clientChannel.attach(function (err) {
if (err) {
cb(err, clientRealtime);
return;
}
clientChannel.presence.enter(testData, function (err) {
cb(err, clientRealtime);
});
});
});
monitorConnection(done, clientRealtime);
};

runTestWithEventListener(done, channelName, eventListener, enterOn);
});

/*
* Check that encodable presence messages are encoded correctly
*/
Expand Down

0 comments on commit 486e958

Please sign in to comment.