diff --git a/modules/static/charybdis.css b/modules/static/charybdis.css index cd5ea51a3..7bc108feb 100644 --- a/modules/static/charybdis.css +++ b/modules/static/charybdis.css @@ -2117,12 +2117,11 @@ div.main div.list div.item div.head div.focus:hover.selected .ircd .room div.status div.explore { - justify-content: center; } .ircd .room div.status div.explore i { - margin: auto; + align-self: center; } /* detail control bar */ @@ -3014,7 +3013,7 @@ div.main div.list div.item div.head div.focus:hover.selected { flex-shrink: 0; position: relative; - flex-flow: row wrap; + flex-flow: row nowrap; align-items: flex-start; justify-content: flex-start; align-content: flex-start; diff --git a/modules/static/charybdis/auth.js b/modules/static/charybdis/auth.js index 0b936f138..750faf57c 100644 --- a/modules/static/charybdis/auth.js +++ b/modules/static/charybdis/auth.js @@ -174,6 +174,9 @@ mc.auth["m.register.user"] = async function(opts = {}) mc.auth.logout = async function(opts = {}) { + if(!mc.instance.authentic) + return false; + let request = mc.m.logout.post(opts); let data = await request.response; delete mc.session.access_token; diff --git a/modules/static/charybdis/datetime.js b/modules/static/charybdis/datetime.js index 5725ddba2..a60cfd81e 100644 --- a/modules/static/charybdis/datetime.js +++ b/modules/static/charybdis/datetime.js @@ -107,7 +107,7 @@ mc.date.describe.elapsed = (ms, short = false) => for(let key in order) { let val = parseInt(order[key]); - if(val <= 0) + if(val <= 0.0001) continue; let unit = short? key[0] : " " + key; diff --git a/modules/static/charybdis/debug.js b/modules/static/charybdis/debug.js index 168e6c6ed..f9a0839cb 100644 --- a/modules/static/charybdis/debug.js +++ b/modules/static/charybdis/debug.js @@ -49,7 +49,7 @@ const debug = * @param {number} r - The current frame's recursion depth. * @returns {string} A string representation of the object. */ - stringify(obj, r_max = 10, enumerator = Object.oeach, r = 1) + stringify(obj, r_max = 10, enumerator = Object.aeach, r = 1) { let tabular = (r, ret = "", i = 0) => { @@ -111,19 +111,19 @@ const debug = return ret + "\n" + tabular(r - 1) + "}"; }, - log(func, obj, r_max = 1, enumerator = Object.oeach) + log(func, obj, r_max = 1, enumerator = Object.aeach) { func(this.stringify(obj, r_max, enumerator)); }, /** Stringify to console.log() */ - object(obj, r_max = 2, enumerator = Object.oeach) + object(obj, r_max = 2, enumerator = Object.aeach) { this.log(console.log, obj, r_max, enumerator); }, /** Stringify to console.error() */ - error(obj, r_max = 2, enumerator = Object.oeach) + error(obj, r_max = 2, enumerator = Object.aeach) { this.log(console.error, obj, r_max, enumerator); }, diff --git a/modules/static/charybdis/io.request.js b/modules/static/charybdis/io.request.js index 6fd7b4ff8..88a902dfc 100644 --- a/modules/static/charybdis/io.request.js +++ b/modules/static/charybdis/io.request.js @@ -164,7 +164,11 @@ mc.io.request.constructor = function(ctx = {}) // This should be done here for now this.xhr.open(this.ctx.method, this.ctx.url); - console.log(this.ctx.method + " " + this.ctx.resource + " " + this.ctx.url + " " + maybe(() => this.ctx.content.length) + " bytes"); + console.log(this.ctx.method + + " " + this.ctx.resource + + " " + this.ctx.url + + " sending " + maybe(() => this.ctx.content.length) + " bytes" + ); } /** Construct XHR related for the request. @@ -249,7 +253,13 @@ mc.io.request.destructor = function() let type = xhr.responseType; let bytes_up = this.uploaded(); let bytes_down = this.loaded(); - console.log(xhr.status + " " + ctx.method + " " + ctx.resource + " sent:" + bytes_up + " recv:" + bytes_down + " " + type); + console.log(xhr.status + + " " + ctx.method + + " " + ctx.resource + + " sent:" + bytes_up + + " recv:" + bytes_down + + " " + type + ); }; /** @@ -417,6 +427,7 @@ mc.io.request.on.readystatechange[XMLHttpRequest.OPENED] = function(event) mc.io.request.on.readystatechange[XMLHttpRequest.HEADERS_RECEIVED] = function(event) { + //console.log("" + xhr.getAllResponseHeaders()); }; mc.io.request.on.readystatechange[XMLHttpRequest.LOADING] = function(event) @@ -427,7 +438,8 @@ mc.io.request.on.readystatechange[XMLHttpRequest.DONE] = function(event) { mc.io.request.destructor.call(this); - switch(this.xhr.status / 100) + let code = parseInt(this.xhr.status); + switch(Math.floor(code / 100)) { case 2: // 2xx return mc.io.request.success.call(this, event); @@ -457,6 +469,7 @@ mc.io.request.on.progress = function(event) mc.io.stats.sent.msgs++; else mc.io.stats.recv.msgs++; + } mc.io.request.on.load = function(event) diff --git a/modules/static/charybdis/main.js b/modules/static/charybdis/main.js index a14525dae..9aec16e69 100644 --- a/modules/static/charybdis/main.js +++ b/modules/static/charybdis/main.js @@ -256,7 +256,7 @@ mc.main.on_logout = function() */ mc.main.menu = { - "": + "MENU": { icon: "fa-bars", target: "#charybdis_menu", diff --git a/modules/static/charybdis/mc.js b/modules/static/charybdis/mc.js index 786edc719..f3326d5b1 100644 --- a/modules/static/charybdis/mc.js +++ b/modules/static/charybdis/mc.js @@ -52,7 +52,8 @@ let client = mc; mc.opts = { // Base URL to use if there is no real window location (i.e browsing from file://) - base_url: new String(window.location.origin), + //base_url: "https://matrix.org:8448", + base_url: String(window.location.origin), // The root element for the application in the DOM. root: "#charybdis", diff --git a/modules/static/charybdis/users.js b/modules/static/charybdis/users.js index 5910fcd68..a685c42e9 100644 --- a/modules/static/charybdis/users.js +++ b/modules/static/charybdis/users.js @@ -97,6 +97,12 @@ mc.users.learn = function(event) if(!user.last_active_ago || user.last_active_ago > elapsed) user.last_active_ago = elapsed; } + + if(event.sender) + if(event.type == "m.room.member") + if(event.membership == "join") + if(maybe(() => event.content.displayname)) + this.get(event.sender).displayname = event.content.displayname; }; mc.users.add = function(mxid) diff --git a/modules/static/index.html b/modules/static/index.html index 981825dbc..5eb5a0528 100644 --- a/modules/static/index.html +++ b/modules/static/index.html @@ -38,7 +38,7 @@ lang="en" --> - Charybdis 5 - Internet Relay Collaboration + Charybdis 5 - Internet Relay Collaboration @@ -48,10 +48,10 @@ ng-app="ircd" ng-class="{ loaded: true }" > - +----------------------------------------------------------------------------->