import { 
  APP_INITIALIZE, 
  APP_UPDATE_STATUS, 
  APP_SET_DIALOG, 
  CHANNEL_UPDATE,
  CHANNEL_VOLUME_UPDATE,
  MESSAGE_TOGGLE_PROPERTY,
  MESSAGE_REMOVE,
} from './constants'

export function updateAppStatus(status, error) {
  return { 
    type: APP_UPDATE_STATUS, 
    error,
    status,
  }
}

export function initializeApp(data) { 
  return {
    type : APP_INITIALIZE, 
    data,
  }
}

export function toggleMessageRead(id) {
  return {
    type     : MESSAGE_TOGGLE_PROPERTY, 
    property : 'read',
    id,
  }
}

export function toggleMessageSelected(id) {
  return {
    type     : MESSAGE_TOGGLE_PROPERTY, 
    property : 'selected',
    id,
  }
}


export function toggleMessageFavorite(id) {
  return {
    type     : MESSAGE_TOGGLE_PROPERTY, 
    property : 'favorite',
    id,
  }
}

export function removeMessage(id) {
  return {
    type : MESSAGE_REMOVE, 
    id,
  }
}

export function updateChannel(id, data) {
  return {
    type : CHANNEL_UPDATE, 
    id,
    data,
  }
}

export function updateChannelVolume(id, level) {
  return {
    type : CHANNEL_VOLUME_UPDATE, 
    id,
    level,
  }
}

export function setDialog(dialog, state) {
  return {
    type : APP_SET_DIALOG,
    dialog,
    state,
  }
}

@@ -32,40 +32,40 @@
 APP_
-UPDATE_STATUS, %0A  APP_SET_DIALOG
+SET_DIALOG, %0A  APP_UPDATE_STATUS
 , %0A 
@@ -106,16 +106,59 @@
 UPDATE,%0A
+  MESSAGE_MARK_ALL_READ,%0A  MESSAGE_REMOVE,%0A
   MESSAG
@@ -176,34 +176,16 @@
 OPERTY,%0A
-  MESSAGE_REMOVE,%0A
 %7D from '
@@ -536,32 +536,129 @@
 %0A    id,%0A  %7D%0A%7D%0A%0A
+export function markAllMessagesRead() %7B%0A  return %7B%0A    type     : MESSAGE_MARK_ALL_READ, %0A  %7D%0A%7D%0A%0A
 export function 

create action to mark all messages read