Revision 27789968

View differences:

html/textroomtest.js
338 338
		transaction: randomString(12),
339 339
		room: myroom,
340 340
 		text: data,
341
 		ack: true // should server acknowledge message reciept? (does NOT acknowledge receipt by other clients)
342 341
	};
342
	// Note: messages are always acknowledged by default. This means that you'll
343
	// always receive a confirmation back that the message has been received by the
344
	// server and forwarded to the recipients. If you do not want this to happen,
345
	// just add an ack:false property to the message above, and server won't send
346
	// you a response (meaning you just have to hope it succeeded).
343 347
	textroom.data({
344 348
		text: JSON.stringify(message),
345 349
		error: function(reason) { bootbox.alert(reason); },
plugins/janus_textroom.c
804 804
		}
805 805
		g_free(msg_text);
806 806
		janus_mutex_unlock(&textroom->mutex);
807
		/* Should we send ack event? Yes if no ack field provided, else follow field directive */
807
		/* By default we send a confirmation back to the user that sent this message:
808
		 * if the user passed an ack=false, though, we don't do that */
808 809
		json_t *ack = json_object_get(root, "ack");
809 810
		if(!internal && (ack == NULL || json_is_true(ack))) {
810 811
			/* Send response back */
811 812
			char *reply_text = json_dumps(reply, JSON_INDENT(3) | JSON_PRESERVE_ORDER);
812
			json_decref(reply);
813 813
			gateway->relay_data(handle, reply_text, strlen(reply_text));
814 814
			g_free(reply_text);
815 815
		}
816
		json_decref(reply);
816 817
	} else if(!strcasecmp(request_text, "join")) {
817 818
		JANUS_VALIDATE_JSON_OBJECT(root, join_parameters,
818 819
			error_code, error_cause, TRUE,

Also available in: Unified diff