import { 
  APP_INITIALIZE, 
  APP_UPDATE_STATUS, 
  CHANNEL_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,
  }
}

@@ -62,16 +62,41 @@
 UPDATE,%0A
+  CHANNEL_VOLUME_UPDATE,%0A
   MESSAG
@@ -153,17 +153,16 @@
 stants'%0A
-%0A
 export f
@@ -955,24 +955,145 @@
     id,%0A    data,%0A  %7D%0A%7D%0A
+%0Aexport function updateChannelVolume(id, level) %7B%0A  return %7B%0A    type : CHANNEL_VOLUME_UPDATE, %0A    id,%0A    level,%0A  %7D%0A%7D%0A

implement updateChannelVolume action