@linktr.ee/messaging-react 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -1393,6 +1393,29 @@ export { }
|
|
|
1393
1393
|
|
|
1394
1394
|
|
|
1395
1395
|
declare module 'stream-chat' {
|
|
1396
|
+
interface CustomChannelData {
|
|
1397
|
+
/**
|
|
1398
|
+
* Whether the channel has at least one visitor-originated message.
|
|
1399
|
+
* Legacy channels may omit this field.
|
|
1400
|
+
*/
|
|
1401
|
+
has_visitor_message?: boolean;
|
|
1402
|
+
/**
|
|
1403
|
+
* Priority score assigned by backend classification for spotlighting.
|
|
1404
|
+
*/
|
|
1405
|
+
priority_score?: number;
|
|
1406
|
+
/**
|
|
1407
|
+
* Indicates a paid message is pending creator reply.
|
|
1408
|
+
*/
|
|
1409
|
+
pending_earn_message_reply?: boolean;
|
|
1410
|
+
/**
|
|
1411
|
+
* Indicates DM agent has deferred and creator follow-up is needed.
|
|
1412
|
+
*/
|
|
1413
|
+
agent_deferred?: boolean;
|
|
1414
|
+
/**
|
|
1415
|
+
* Whether DM agent auto-replies are paused for this channel.
|
|
1416
|
+
*/
|
|
1417
|
+
chatbot_paused?: boolean;
|
|
1418
|
+
}
|
|
1396
1419
|
interface CustomMessageData {
|
|
1397
1420
|
/**
|
|
1398
1421
|
* When true, hides the date timestamp in system messages.
|
package/package.json
CHANGED
|
@@ -472,9 +472,7 @@ export const ChannelView = React.memo<ChannelViewProps>(
|
|
|
472
472
|
message: Parameters<ChannelType['sendMessage']>[0],
|
|
473
473
|
options?: Parameters<ChannelType['sendMessage']>[1]
|
|
474
474
|
) => {
|
|
475
|
-
const agentPaused =
|
|
476
|
-
(channel.data as { chatbot_paused?: boolean })?.chatbot_paused ===
|
|
477
|
-
true
|
|
475
|
+
const agentPaused = channel.data?.chatbot_paused === true
|
|
478
476
|
const shouldSuppressNotifications = dmAgentEnabled && !agentPaused
|
|
479
477
|
|
|
480
478
|
// Build final message with nested metadata
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Stream Chat custom data type augmentation.
|
|
3
3
|
*
|
|
4
4
|
* This file extends Stream Chat's type system by augmenting their empty
|
|
5
|
-
* CustomMessageData
|
|
5
|
+
* CustomMessageData and CustomChannelData interfaces with our custom properties.
|
|
6
6
|
*
|
|
7
7
|
* @see https://getstream.io/chat/docs/sdk/react/guides/typescript_and_custom_data_types/
|
|
8
8
|
*
|
|
@@ -46,6 +46,30 @@ export interface MessageMetadata {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
declare module 'stream-chat' {
|
|
49
|
+
interface CustomChannelData {
|
|
50
|
+
/**
|
|
51
|
+
* Whether the channel has at least one visitor-originated message.
|
|
52
|
+
* Legacy channels may omit this field.
|
|
53
|
+
*/
|
|
54
|
+
has_visitor_message?: boolean
|
|
55
|
+
/**
|
|
56
|
+
* Priority score assigned by backend classification for spotlighting.
|
|
57
|
+
*/
|
|
58
|
+
priority_score?: number
|
|
59
|
+
/**
|
|
60
|
+
* Indicates a paid message is pending creator reply.
|
|
61
|
+
*/
|
|
62
|
+
pending_earn_message_reply?: boolean
|
|
63
|
+
/**
|
|
64
|
+
* Indicates DM agent has deferred and creator follow-up is needed.
|
|
65
|
+
*/
|
|
66
|
+
agent_deferred?: boolean
|
|
67
|
+
/**
|
|
68
|
+
* Whether DM agent auto-replies are paused for this channel.
|
|
69
|
+
*/
|
|
70
|
+
chatbot_paused?: boolean
|
|
71
|
+
}
|
|
72
|
+
|
|
49
73
|
interface CustomMessageData {
|
|
50
74
|
/**
|
|
51
75
|
* When true, hides the date timestamp in system messages.
|