Skip to content

Conversation

@aforge
Copy link
Contributor

@aforge aforge commented Jun 2, 2021

We need to notify group members of a new subscription.
Presently, this is only available in p2p topic.

This is the reason why new subscriptions show up as unknown (id) in group chats in certain cases.

We need to notify group members of a new subscription.
Presently, this is only available in p2p topic.
@aforge aforge requested a review from or-else June 2, 2021 16:18
Copy link
Contributor

@or-else or-else left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug in Android which also independently caused 'Not found' group members:
tinode/tindroid@055f8b5
Specifically changes like this fixed it:

if (isP2PType()) {
    mTinode.updateUser(getName(), mDesc);
}

It probably exists in iOS too.

server/topic.go Outdated
}
}
} else if t.cat == types.TopicCatGrp {
if pushRcpt := t.pushForGroupSub(asUid, types.TimeNow()); pushRcpt != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also check if sreg.pkt.Sub.Newsub is true. Otherwise pushes will be sent on all permission changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

server/topic.go Outdated
}

// Prepares payload to be delivered to a mobile device as a push notification in response to a new subscription in a p2p topic.
func (t *Topic) pushForSub(fromUid, toUid types.Uid, want, given types.AccessMode, now time.Time) *push.Receipt {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to pushForP2PSub?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@aforge
Copy link
Contributor Author

aforge commented Jun 3, 2021

There was a bug in Android which also independently caused 'Not found' group members:
tinode/tindroid@055f8b5
Specifically changes like this fixed it:

if (isP2PType()) {
    mTinode.updateUser(getName(), mDesc);
}

It probably exists in iOS too.

Thanks. I'll make comparable changes in iOS.

@aforge aforge merged commit b823c29 into devel Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants