#include "..\script_component.hpp"

/*
 * Function: forge_client_phone_fnc_addContact
 * Author: IDSolutions
 *
 * [Description]
 * Adds a contact to the address book.
 *
 * Arguments:
 * 0: Contact <OBJECT> - The contact to add
 *
 * Return Value:
 * None
 *
 * Example:
 * [cursorObject] call forge_client_phone_fnc_addContact;
 *
 * Public: Yes
 */

params ["_contact"];

private _defaultPhoneNumber = "unknown";
private _defaultEmail = "unknown@spearnet.mil";

private _name = name _contact;
private _phoneNumber = GETVAR(_contact,FORGE_Phone_Number,_defaultPhoneNumber);
private _email = GETVAR(_contact,FORGE_Email,_defaultEmail);

GVAR(addressbook) pushBackUnique [_name, _phoneNumber, _email];

SETVAR(profileNamespace,FORGE_AddressBook,GVAR(addressbook));