 # this file named as socialaccount while it is under social folder, because i
 # dont want it to be listed first item while searching for account.coffe in
 # sublime ~ CS
+
+removeParticipantHandler = (data) ->
+  participantHandler 'removeParticipants', data
+
+addParticipantHandler = (data) ->
+  participantHandler 'addParticipants', data
 
 # SocialAccount
 module.exports = class SocialAccount extends Base


      updateSocialAccount username

    JGroup.on 'MemberRemoved', (data) ->
      participantHandler 'removeParticipants', data

    JGroup.on 'MemberAdded', (data) ->
      participantHandler 'addParticipants', data


participantHandler = (funcName, data) ->

  { bareRequest } = require './helper'

  @update = (args...) -> bareRequest 'updateAccount', args...

  @removeParticipant = removeParticipantHandler

  @addParticipant = addParticipantHandler

  do ->
    JAccount = require '../account'
