Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Hotfix/cbuffer #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cbuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class CBuffer {
startIdx = startIdx | 0;
beforeIdx = beforeIdx || this.buffer.length;
for (let i = startIdx; i < beforeIdx; i++) {
callback(context, this.buffer[i], i);
callback.call(context, this.buffer[i], i);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tinode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ export class Tinode {
*/
isTopicOnline(topicName: string): boolean {
const me = this.getMeTopic();
const cont = me && me.getContact(name);
const cont = me && me.getContact(topicName);
return cont && cont.online;
}
}
4 changes: 2 additions & 2 deletions src/topic/topic-me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class TopicMe extends Topic {
if (!sub.noForwarding) {
const topic = this.tinode.getTopic(topicName);
if (topic) {
sub._noForwarding = true;
topic._processMetaDesc(sub);
sub.noForwarding = true;
topic.processMetaDesc(sub);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/topic/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class Topic {
// If topic name is explicitly provided, use it. If no name, then it's a new group topic, use "new".
const ctrl = await this.tinode.subscribe(this.name || TopicNames.TOPIC_NEW, getParams, setParams);

if (ctrl.code >= 300) {
if (ctrl.code >= 400) {
// Do nothing if the topic is already subscribed to.
return ctrl;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Utilities {
for (const prop in src) {
if (src.hasOwnProperty(prop) &&
(!ignore || !ignore[prop]) &&
(prop !== '_noForwarding')) {
(prop !== 'noForwarding')) {

dst[prop] = Utilities.mergeObj(dst[prop], src[prop]);
}
Expand Down