Skip to content

Commit 28d1759

Browse files
committed
feat: add message class abstracting message handling (#23)
* refactor: add comments to clarify flow Signed-off-by: Gerard Hickey <[email protected]> * 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 <[email protected]> * add more config support Signed-off-by: Gerard Hickey <[email protected]> * feat: message ID can be specified in send_message API Signed-off-by: Gerard Hickey <[email protected]> * add md5 module to front-end Signed-off-by: Gerard Hickey <[email protected]> * integrate message class into front-end code Signed-off-by: Gerard Hickey <[email protected]> --------- Signed-off-by: Gerard Hickey <[email protected]>
1 parent bfadccb commit 28d1759

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

www/chat.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
var meshchat_id;
22
var last_messages_update = epoch();
3-
var call_sign = 'NOCALL';
4-
var enable_video = 0;
5-
6-
var messages = new Messages();
7-
let alert = new Audio('alert.mp3');
8-
9-
let config = {};
10-
let context = {
11-
config_loaded: false,
12-
debug: true, // let startup funcs show debug
13-
}
3+
var call_sign = 'NOCALL';
4+
var meshchat_id;
5+
var peer;
6+
var mediaConnection;
7+
var enable_video = 0;
8+
var messages_updating = false;
9+
var users_updating = false;
10+
var messages = [];
11+
var channel_filter = '';
12+
var messages_version = 0;
13+
var alert = new Audio('alert.mp3');
14+
var message_db_version = 0;
15+
var pending_message_db_version = 0;
16+
var search_filter = '';
1417

1518
$(function() {
1619
meshchat_init();
@@ -133,7 +136,7 @@ function meshchat_init() {
133136
Cookies.set('meshchat_id', make_id());
134137
meshchat_id = Cookies.get('meshchat_id');
135138
}
136-
//console.log(meshchat_id);
139+
137140
$('#submit-message').on('click', function(e) {
138141
e.preventDefault();
139142
if ($('#message').val().length == 0) return;

0 commit comments

Comments
 (0)