Skip to content

Commit

Permalink
feat: add message class abstracting message handling (#23)
Browse files Browse the repository at this point in the history
* refactor: add comments to clarify flow

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: add messages class to front end

Update the handling of messages on the front end code to better control
the update of messages and coordinateion with the rest of the UI.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add more config support

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* feat: message ID can be specified in send_message API

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* add md5 module to front-end

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* integrate message class into front-end code

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
  • Loading branch information
hickey committed Mar 2, 2024
1 parent bfadccb commit 28d1759
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions www/chat.js
@@ -1,16 +1,19 @@
var meshchat_id;
var last_messages_update = epoch();
var call_sign = 'NOCALL';
var enable_video = 0;

var messages = new Messages();
let alert = new Audio('alert.mp3');

let config = {};
let context = {
config_loaded: false,
debug: true, // let startup funcs show debug
}
var call_sign = 'NOCALL';
var meshchat_id;
var peer;
var mediaConnection;
var enable_video = 0;
var messages_updating = false;
var users_updating = false;
var messages = [];
var channel_filter = '';
var messages_version = 0;
var alert = new Audio('alert.mp3');
var message_db_version = 0;
var pending_message_db_version = 0;
var search_filter = '';

$(function() {
meshchat_init();
Expand Down Expand Up @@ -133,7 +136,7 @@ function meshchat_init() {
Cookies.set('meshchat_id', make_id());
meshchat_id = Cookies.get('meshchat_id');
}
//console.log(meshchat_id);

$('#submit-message').on('click', function(e) {
e.preventDefault();
if ($('#message').val().length == 0) return;
Expand Down

0 comments on commit 28d1759

Please sign in to comment.