@Override
	public void run() {
		while (true) {
			try {
				System.out.println("Presence service is running");
				LinkedList<String> previousNearbyUsers = new LinkedList<String>();
				/*
				 * Find out current devices in the room
				 */
				this.nearbyUsersSemaphore.acquire();
				if (!this.nearbyUsers.isEmpty()) {
					previousNearbyUsers.addAll(this.nearbyUsers);
					this.nearbyUsers.clear();
				}
				this.presence.resetDevs();
				this.presence.detectDevs();
				this.nearbyUsers.addAll(this.presence.getDevs());
				
				for(String deviceId: staticNearbyUsers) {
					if(!nearbyUsers.contains(deviceId)) {
						this.nearbyUsers.add(deviceId);
					}
				}
				/*
				 * Which devices left the room?
				 */
				previousNearbyUsers.removeAll(this.nearbyUsers);

				/*
				 * TODO: Decide if this is necessary. Might make things ugly.
				 */
				/*
				 * Publish the users that present in the previous sweep but not
				 * in this one
				 */
				for (String userDeviceId : previousNearbyUsers) {
					String twitterName = db.getTwitterNameFromDeviceId(userDeviceId);
					if(twitterName == null)
						continue;
					db.logOutUserWithDeviceId(userDeviceId);
					this.messagesToPublish.add(String.format("@%s left the room.", twitterName));
				}
				this.nearbyUsersSemaphore.release();
				break;
			} catch (InterruptedException e) {

			}
		}
	}