@zohoim/client-sdk 1.0.0-poc81 → 1.0.0-poc82
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.
|
@@ -51,6 +51,10 @@ export default class Message {
|
|
|
51
51
|
return direction === MessageDirection.OUT;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
static isIncoming(direction) {
|
|
55
|
+
return direction === MessageDirection.IN;
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
static isInfo(type) {
|
|
55
59
|
return type === MessageTypes.INFO;
|
|
56
60
|
}
|
|
@@ -59,6 +63,10 @@ export default class Message {
|
|
|
59
63
|
return type === MessageTypes.ATTACHMENT;
|
|
60
64
|
}
|
|
61
65
|
|
|
66
|
+
static isTemplate(type) {
|
|
67
|
+
return type === MessageTypes.TEMPLATE;
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
static isSystemMessage(message) {
|
|
63
71
|
return !!message;
|
|
64
72
|
}
|
|
@@ -71,7 +79,9 @@ export default class Message {
|
|
|
71
79
|
return status === MessageStatus.FAILED;
|
|
72
80
|
}
|
|
73
81
|
|
|
74
|
-
static getMetaValue(
|
|
82
|
+
static getMetaValue() {
|
|
83
|
+
let meta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
84
|
+
let key = arguments.length > 1 ? arguments[1] : undefined;
|
|
75
85
|
const item = meta.find(item => item.name === key);
|
|
76
86
|
return item ? item.value : '';
|
|
77
87
|
}
|