@Override
	public void handleIt(Object... args) {
		Scanner inputReader = new Scanner(System.in);
		
		// Getting current user and socket from passed arguments.
		currentUser = (User) args[1];
		sock = (Socket) args[0];
		
		// This loop is only broken when the user has successfully specified
		// a recipient for the message that is being sent.
		while (!recipientFilled) {
			System.out.print("-- ");
			userInput = inputReader.nextLine();
			if (!userInput.contains(":")) {
				System.out.println("[SendMessageHandler] Must specify a recipient! (remember to follow username with a colon)");
				// handleIt(args);
				// return;
				// The above commented-out code is only necessary without the loop.
			} else {
				recipientFilled = true;
			}
		}

		int delimiterIndex = userInput.indexOf(':');
		message = "";

		if (delimiterIndex != -1) {
			message = userInput.substring(delimiterIndex + 1);
		}

		// Getting recipient string
		String recipient = userInput.substring(0, delimiterIndex);
		
		// Trimming recipient and message strings to size.
		recipient = recipient.trim();
		recipient = recipient.toLowerCase();
		message = message.trim();
		
		// Building message time stamp
		long messageTimeStamp = new Date().getTime();
		
		// Creating message based on user input and passed arguments.
		messageToBeSent = new MessageBean(currentUser.getUsername(), recipient, String.valueOf(messageTimeStamp), message);

		try {
			// Getting output stream and writing message object to the server.
			JSONOutputStream jsonOut = new JSONOutputStream(sock.getOutputStream());
			jsonOut.writeObject(messageToBeSent);
			
			// Getting a confirmation for the server for the delivery of the message
			int confirmation = sock.getInputStream().read();
			if(confirmation == 1) {
				recipientFilled = false;
			} else {
				System.out.println("[SendMessageHandler] Failed to deliver message: " + messageToBeSent.toString());
			}

		} catch (IOException e) {
			e.printStackTrace();
		} catch (JSONException e) {
			e.printStackTrace();
		} catch (StringIndexOutOfBoundsException e) {
			e.printStackTrace();
		}

	}