function Meeting(group, members, type, moderator, description, location) {
    this.members = members;
    this.group = group;
    this.type = type;
    this.location = location;
    this.startTime = new Date();
    this.timestamp = this.startTime.getTime()/1000
    this.moderator = moderator;
    this.description = description;
    this.uuid = device.uuid + "_" + this.startTime.getTime();
    this.log_index = 0

    this.toPost = []

    this.showVisualization = function() { return true }();

    var meeting = this;


    $.each(this.members, function(index, member) {
        member.clearData();
    }.bind(this));

    this.logChunk = function(chunk, member) {

        var chunk_data = chunk.toDict(member);
        this.writeLog("audio received", chunk_data);

    }.bind(this);


    this.logScanChunk = function(chunk, member) {
        var chunk_data = chunk.toDict(member);
        this.writeLog("proximity received", chunk_data);
        console.log("scan received", chunk_data);

    }.bind(this);



    this.logPauseStart = function() {
        this.writeLog("pause started", null)
    }.bind(this);

    this.logPauseEnd = function(cause, remaining) {
        this.writeLog("pause ended", {'resume_cause':cause,
                                 'seconds_remaining':remaining})
    }.bind(this);


    this.logMeetingMemberAdd = function(member) {
      this.writeLog("member changed", {'member_key':member.key,
                                          "change":"join"})
    }.bind(this);

    this.logMeetingMemberRemove = function(member) {
        this.writeLog("member changed", {'member_key':member.key,
                                            "change":"leave"})
    }.bind(this);


    this.getLogName = function() {
        return this.uuid + ".txt";
    }.bind(this);

    this.writeLog = function(type, data) {

      var log_obj = { 'type':type,
              'log_timestamp':new Date()/1000,
                  'log_index':this.log_index,
                        'hub':device.uuid,
                       'data':data }

      this.log_index += 1
      var str = JSON.stringify(log_obj) + '\n'
      return window.fileStorage.save(this.getLogName(), str);
    }.bind(this);


    this.printLogFile = function() {
        window.fileStorage.load(this.getLogName()).done(function (data) {
            console.log(data);
        });
    }.bind(this);

    var memberIds = [];
    var memberInitials = [];
    $.each(this.members, function(index, member) {
        memberIds.push(member.key);
        memberInitials.push(getInitials(member.name));
        member.meeting = meeting;
    });
    this.memberKeys = memberIds;
    this.memberInitials = memberInitials;


    this.updateMeeting = function() {
      var memberIds = [];
      var memberInitials = [];
      $.each(this.members, function(index, member) {
        memberIds.push(member.key);
        memberInitials.push(getInitials(member.name));
        member.meeting = meeting;
      });
      this.memberKeys = memberIds;
      this.memberInitials = memberInitials;
    }

    this.syncLogFile = function(isComplete, endingMethod) {
      app.getCompletedMeetings(function (meetings) {
        app.syncLogFile(this.getLogName(), !!isComplete, endingMethod, new Date().toJSON(), meetings);
      }.bind(this))
    }.bind(this);



    this.initializeMeeting = function() {
        var split = new Date().toString().split(" ");
        var timeZoneFormatted = split[split.length - 2] + " " + split[split.length - 1];

        console.log("initializing meeting")

        this.writeLog("meeting started", {
            'uuid': this.uuid,
            'start_time':new Date()/1000,
            'log_version':"2.0",
            'hub_version':window.gitRevision,
            'moderator':this.moderator,
            'location':this.location,
            'description': this.description.replace(/\s\s+/g, ' '),
            'type':this.type
        }).then(this.writeLog("hub joined", {
                "uuid":device.uuid,
                "locale":timeZoneFormatted
        }))
    }.bind(this);

    this.initializeMeeting()

}
/**
 * Meeting Model
 *
 * This is in charge of logging all data to the log file
 */
Meeting Model
This is in charge of logging all data to the log file
Meeting Model This is in charge of logging all data to the log file
function Meeting(group, members, type, moderator, description, location) {
    this.members = members;
    this.group = group;
    this.type = type;
    this.location = location;
    this.startTime = new Date();
    this.timestamp = this.startTime.getTime()/1000
    this.moderator = moderator;
    this.description = description;
    this.uuid = device.uuid + "_" + this.startTime.getTime();
    this.log_index = 0
    this.toPost = []
    this.showVisualization = function() { return true }();
    var meeting = this;
    $.each(this.members, function(index, member) {
        member.clearData();
    }.bind(this));
    this.logChunk = function(chunk, member) {
        var chunk_data = chunk.toDict(member);
        this.writeLog("audio received", chunk_data);
    }.bind(this);
    this.logScanChunk = function(chunk, member) {
        var chunk_data = chunk.toDict(member);
        this.writeLog("proximity received", chunk_data);
        console.log("scan received", chunk_data);
    }.bind(this);
    this.logPauseStart = function() {
        this.writeLog("pause started", null)
    }.bind(this);
    this.logPauseEnd = function(cause, remaining) {
        this.writeLog("pause ended", {'resume_cause':cause,
                                 'seconds_remaining':remaining})
    }.bind(this);
    this.logMeetingMemberAdd = function(member) {
      this.writeLog("member changed", {'member_key':member.key,
                                          "change":"join"})
    }.bind(this);
    this.logMeetingMemberRemove = function(member) {
        this.writeLog("member changed", {'member_key':member.key,
                                            "change":"leave"})
    }.bind(this);
    this.getLogName = function() {
        return this.uuid + ".txt";
    }.bind(this);
    this.writeLog = function(type, data) {
      var log_obj = { 'type':type,
              'log_timestamp':new Date()/1000,
                  'log_index':this.log_index,
                        'hub':device.uuid,
                       'data':data }
      this.log_index += 1
      var str = JSON.stringify(log_obj) + '\n'
      return window.fileStorage.save(this.getLogName(), str);
    }.bind(this);
    this.printLogFile = function() {
        window.fileStorage.load(this.getLogName()).done(function (data) {
            console.log(data);
        });
    }.bind(this);
    var memberIds = [];
    var memberInitials = [];
    $.each(this.members, function(index, member) {
        memberIds.push(member.key);
        memberInitials.push(getInitials(member.name));
        member.meeting = meeting;
    });
    this.memberKeys = memberIds;
    this.memberInitials = memberInitials;
    this.updateMeeting = function() {
      var memberIds = [];
      var memberInitials = [];
      $.each(this.members, function(index, member) {
        memberIds.push(member.key);
        memberInitials.push(getInitials(member.name));
        member.meeting = meeting;
      });
      this.memberKeys = memberIds;
      this.memberInitials = memberInitials;
    }
    this.syncLogFile = function(isComplete, endingMethod) {
      app.getCompletedMeetings(function (meetings) {
        app.syncLogFile(this.getLogName(), !!isComplete, endingMethod, new Date().toJSON(), meetings);
      }.bind(this))
    }.bind(this);
    this.initializeMeeting = function() {
        var split = new Date().toString().split(" ");
        var timeZoneFormatted = split[split.length - 2] + " " + split[split.length - 1];
        console.log("initializing meeting")
        this.writeLog("meeting started", {
            'uuid': this.uuid,
            'start_time':new Date()/1000,
            'log_version':"2.0",
            'hub_version':window.gitRevision,
            'moderator':this.moderator,
            'location':this.location,
            'description': this.description.replace(/\s\s+/g, ' '),
            'type':this.type
        }).then(this.writeLog("hub joined", {
                "uuid":device.uuid,
                "locale":timeZoneFormatted
        }))
    }.bind(this);
    this.initializeMeeting()
}
function Meeting ( group , members , type , moderator , description , location ) { this . members = members ; this . group = group ; this . type = type ; this . location = location ; this . startTime = new Date ( ) ; this . timestamp = this . startTime . getTime ( ) / 1000 this . moderator = moderator ; this . description = description ; this . uuid = device . uuid + "_" + this . startTime . getTime ( ) ; this . log_index = 0 this . toPost = [ ] this . showVisualization = function ( ) { return true } ( ) ; var meeting = this ; $ . each ( this . members , function ( index , member ) { member . clearData ( ) ; } . bind ( this ) ) ; this . logChunk = function ( chunk , member ) { var chunk_data = chunk . toDict ( member ) ; this . writeLog ( "audio received" , chunk_data ) ; } . bind ( this ) ; this . logScanChunk = function ( chunk , member ) { var chunk_data = chunk . toDict ( member ) ; this . writeLog ( "proximity received" , chunk_data ) ; console . log ( "scan received" , chunk_data ) ; } . bind ( this ) ; this . logPauseStart = function ( ) { this . writeLog ( "pause started" , null ) } . bind ( this ) ; this . logPauseEnd = function ( cause , remaining ) { this . writeLog ( "pause ended" , { 'resume_cause' : cause , 'seconds_remaining' : remaining } ) } . bind ( this ) ; this . logMeetingMemberAdd = function ( member ) { this . writeLog ( "member changed" , { 'member_key' : member . key , "change" : "join" } ) } . bind ( this ) ; this . logMeetingMemberRemove = function ( member ) { this . writeLog ( "member changed" , { 'member_key' : member . key , "change" : "leave" } ) } . bind ( this ) ; this . getLogName = function ( ) { return this . uuid + ".txt" ; } . bind ( this ) ; this . writeLog = function ( type , data ) { var log_obj = { 'type' : type , 'log_timestamp' : new Date ( ) / 1000 , 'log_index' : this . log_index , 'hub' : device . uuid , 'data' : data } this . log_index += 1 var str = JSON . stringify ( log_obj ) + '\n' return window . fileStorage . save ( this . getLogName ( ) , str ) ; } . bind ( this ) ; this . printLogFile = function ( ) { window . fileStorage . load ( this . getLogName ( ) ) . done ( function ( data ) { console . log ( data ) ; } ) ; } . bind ( this ) ; var memberIds = [ ] ; var memberInitials = [ ] ; $ . each ( this . members , function ( index , member ) { memberIds . push ( member . key ) ; memberInitials . push ( getInitials ( member . name ) ) ; member . meeting = meeting ; } ) ; this . memberKeys = memberIds ; this . memberInitials = memberInitials ; this . updateMeeting = function ( ) { var memberIds = [ ] ; var memberInitials = [ ] ; $ . each ( this . members , function ( index , member ) { memberIds . push ( member . key ) ; memberInitials . push ( getInitials ( member . name ) ) ; member . meeting = meeting ; } ) ; this . memberKeys = memberIds ; this . memberInitials = memberInitials ; } this . syncLogFile = function ( isComplete , endingMethod ) { app . getCompletedMeetings ( function ( meetings ) { app . syncLogFile ( this . getLogName ( ) , ! ! isComplete , endingMethod , new Date ( ) . toJSON ( ) , meetings ) ; } . bind ( this ) ) } . bind ( this ) ; this . initializeMeeting = function ( ) { var split = new Date ( ) . toString ( ) . split ( " " ) ; var timeZoneFormatted = split [ split . length - 2 ] + " " + split [ split . length - 1 ] ; console . log ( "initializing meeting" ) this . writeLog ( "meeting started" , { 'uuid' : this . uuid , 'start_time' : new Date ( ) / 1000 , 'log_version' : "2.0" , 'hub_version' : window . gitRevision , 'moderator' : this . moderator , 'location' : this . location , 'description' : this . description . replace ( / \s\s+ / g , ' ' ) , 'type' : this . type } ) . then ( this . writeLog ( "hub joined" , { "uuid" : device . uuid , "locale" : timeZoneFormatted } ) ) } . bind ( this ) ; this . initializeMeeting ( ) }
Meeting Model
 This is in charge of logging all data to the log file
Meeting Model This is in charge of logging all data to the log file