Log when a chat invite is posted or messaged (#10858)
This commit is contained in:
@@ -619,6 +619,10 @@ export type Events = {
|
|||||||
convoId: string
|
convoId: string
|
||||||
method: 'post' | 'copy' | 'native'
|
method: 'post' | 'copy' | 'native'
|
||||||
}
|
}
|
||||||
|
'groupchat:inviteLink:shared': {
|
||||||
|
convoId: string
|
||||||
|
method: 'post' | 'dm'
|
||||||
|
}
|
||||||
|
|
||||||
// Group chat owner actions
|
// Group chat owner actions
|
||||||
'groupchat:owner:editName': {
|
'groupchat:owner:editName': {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import {
|
|||||||
AppBskyRichtextFacet,
|
AppBskyRichtextFacet,
|
||||||
ChatBskyConvoDefs,
|
ChatBskyConvoDefs,
|
||||||
type ChatBskyEmbedJoinLink,
|
type ChatBskyEmbedJoinLink,
|
||||||
|
ChatBskyGroupDefs,
|
||||||
RichText,
|
RichText,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {useScrollEdgeEffectRef} from '@bsky.app/expo-scroll-edge-effect'
|
import {useScrollEdgeEffectRef} from '@bsky.app/expo-scroll-edge-effect'
|
||||||
@@ -478,6 +479,15 @@ export function MessagesList({
|
|||||||
isOwner: convoState.convo.primaryMember?.did === currentAccount?.did,
|
isOwner: convoState.convo.primaryMember?.did === currentAccount?.did,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
embedView?.$type === 'chat.bsky.embed.joinLink#view' &&
|
||||||
|
ChatBskyGroupDefs.isJoinLinkPreviewView(embedView.joinLinkPreview)
|
||||||
|
) {
|
||||||
|
ax.metric('groupchat:inviteLink:shared', {
|
||||||
|
convoId: embedView.joinLinkPreview.convoId,
|
||||||
|
method: 'dm',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
agent,
|
agent,
|
||||||
|
|||||||
@@ -1071,6 +1071,20 @@ export const ComposePost = ({
|
|||||||
isReply: !!replyTo,
|
isReply: !!replyTo,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (postUri) {
|
||||||
|
for (const q of linkQueries) {
|
||||||
|
const resolved = q.data
|
||||||
|
if (
|
||||||
|
resolved?.type === 'chat-invite' &&
|
||||||
|
ChatBskyGroupDefs.isJoinLinkPreviewView(resolved.view)
|
||||||
|
) {
|
||||||
|
ax.metric('groupchat:inviteLink:shared', {
|
||||||
|
convoId: resolved.view.convoId,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (postUri && !replyTo) {
|
if (postUri && !replyTo) {
|
||||||
emitPostCreated()
|
emitPostCreated()
|
||||||
|
|||||||
Reference in New Issue
Block a user