GroupV2: Add 'you were invited' to timeline after link
This commit is contained in:
parent
957a1e0d07
commit
4ef4aebf85
1 changed files with 17 additions and 15 deletions
32
ts/groups.ts
32
ts/groups.ts
|
@ -1259,7 +1259,23 @@ function extractDiffs({
|
||||||
// Here we hardcode initial messages if this is our first time processing data this
|
// Here we hardcode initial messages if this is our first time processing data this
|
||||||
// group. Ideally we can collapse it down to just one of: 'you were added',
|
// group. Ideally we can collapse it down to just one of: 'you were added',
|
||||||
// 'you were invited', or 'you created.'
|
// 'you were invited', or 'you created.'
|
||||||
if (firstUpdate && dropInitialJoinMessage) {
|
if (firstUpdate && ourConversationId && areWeInvitedToGroup) {
|
||||||
|
// Note, we will add 'you were invited' to group even if dropInitialJoinMessage = true
|
||||||
|
message = {
|
||||||
|
...generateBasicMessage(),
|
||||||
|
type: 'group-v2-change',
|
||||||
|
groupV2Change: {
|
||||||
|
from: whoInvitedUsUserId || sourceConversationId,
|
||||||
|
details: [
|
||||||
|
{
|
||||||
|
type: 'pending-add-one',
|
||||||
|
conversationId: ourConversationId,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else if (firstUpdate && dropInitialJoinMessage) {
|
||||||
|
// None of the rest of the messages should be added if dropInitialJoinMessage = true
|
||||||
message = undefined;
|
message = undefined;
|
||||||
} else if (
|
} else if (
|
||||||
firstUpdate &&
|
firstUpdate &&
|
||||||
|
@ -1279,20 +1295,6 @@ function extractDiffs({
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} else if (firstUpdate && ourConversationId && areWeInvitedToGroup) {
|
|
||||||
message = {
|
|
||||||
...generateBasicMessage(),
|
|
||||||
type: 'group-v2-change',
|
|
||||||
groupV2Change: {
|
|
||||||
from: whoInvitedUsUserId || sourceConversationId,
|
|
||||||
details: [
|
|
||||||
{
|
|
||||||
type: 'pending-add-one',
|
|
||||||
conversationId: ourConversationId,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
} else if (firstUpdate && ourConversationId && areWeInGroup) {
|
} else if (firstUpdate && ourConversationId && areWeInGroup) {
|
||||||
message = {
|
message = {
|
||||||
...generateBasicMessage(),
|
...generateBasicMessage(),
|
||||||
|
|
Loading…
Reference in a new issue