         return callback message: "You should have at least one recipient"
       doRequest 'sendPrivateMessage', client, data, callback
 
-  @ensureGroupChannel = (client, callback)->
-    fetchGroup client, (err, group)->
-      return callback err  if err
-      group.createSocialApiChannelId (err, socialApiChannelId)->
-        return callback err  if err
-        callback null, socialApiChannelId
-
   # todo-- ask Chris about using validators.own
   # how to implement for this case
   @canEdit = (client, data, callback)->


  JAccount = require '../account'

  {fetchGroup} = require "./helper"

  Validators = require '../group/validators'
  {permit}   = require '../group/permissionset'

  {fetchGroup, secureRequest, doRequest, permittedRequest} = require "./helper"

  @post = permit 'create posts',
    success: (client, data, callback)->
      SocialMessage.ensureGroupChannel client, (err, socialApiChannelId)->
        data.channelId = socialApiChannelId
        doRequest 'postToChannel', client, data, callback


    success: (client, data, callback)->
      if not data.messageId or not data.body
        return callback message: "Request is not valid for adding a reply"
      ensureGroupChannel client, (err, socialApiChannelId)->
        data.initialChannelId = socialApiChannelId
        doRequest 'addReply', client, data, callback

