Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switch (state) {
case C.DC_STATE_OUT_FAILED:
return 'error'
case C.DC_STATE_OUT_PENDING:
return 'sending'
case C.DC_STATE_OUT_PREPARING:
return 'sending'
case C.DC_STATE_OUT_DRAFT:
return 'draft'
case C.DC_STATE_OUT_DELIVERED:
return 'delivered'
case C.DC_STATE_OUT_MDN_RCVD:
return 'read'
case C.DC_STATE_IN_FRESH:
return 'delivered'
case C.DC_STATE_IN_SEEN:
return 'delivered'
case C.DC_STATE_IN_NOTICED:
return 'read'
default:
return '' // to display no icon on unknown state
}
}
function convertMessageStatus (s) {
switch (s) {
case CONSTANTS.DC_STATE_IN_FRESH:
return 'sent'
case CONSTANTS.DC_STATE_OUT_FAILED:
return 'error'
case CONSTANTS.DC_STATE_IN_SEEN:
return 'read'
case CONSTANTS.DC_STATE_IN_NOTICED:
return 'read'
case CONSTANTS.DC_STATE_OUT_DELIVERED:
return 'delivered'
case CONSTANTS.DC_STATE_OUT_MDN_RCVD:
return 'read'
case CONSTANTS.DC_STATE_OUT_PENDING:
return 'sending'
case CONSTANTS.DC_STATE_UNDEFINED:
return 'error'
}
}
function convertMessageStatus (s) {
switch (s) {
case C.DC_STATE_IN_FRESH:
return 'sent'
case C.DC_STATE_OUT_FAILED:
return 'error'
case C.DC_STATE_IN_SEEN:
return 'read'
case C.DC_STATE_IN_NOTICED:
return 'read'
case C.DC_STATE_OUT_DELIVERED:
return 'delivered'
case C.DC_STATE_OUT_MDN_RCVD:
return 'read'
case C.DC_STATE_OUT_PENDING:
return 'sending'
case C.DC_STATE_UNDEFINED:
return 'error'
}
}