react-native-context-center
Version:
React native package for Impekable context center customer app
27 lines (22 loc) • 809 B
JavaScript
import { NativeModules } from 'react-native';
const { CCMessages } = NativeModules
class ChatMessage{
constructor(props, channelSid) {
this.sid = props.sid;
this.index = props.index;
this.author = props.author;
this.body = props.body;
this.timestamp = new Date(props.timestamp);
this.dateUpdated = props.dateUpdatedAsDate ? new Date(props.dateUpdated) : null;
this.lastUpdatedBy = props.lastUpdatedBy;
this.attributes = props.attributes;
this._channelSid = channelSid;
}
updateBody(body) {
return CCMessages.updateBody(this._channelSid, this.index, body);
}
setAttributes(attributes) {
return CCMessages.setAttributes(this._channelSid, this.index, attributes);
}
}
export default ChatMessage;