1
0
Эх сурвалжийг харах

Merge branch 'issue-72' of isundil/mimouchat into devel

isundil 6 жил өмнө
parent
commit
e989816e89

+ 2 - 0
srv/src/slackHistory.js

@@ -63,6 +63,8 @@ SlackHistory.prototype.messageFactory = function(ev, ts) {
     });
     if (ev["attachments"]) ev["attachments"].forEach(attachment => {
         const slackDomainUri = "https://files.slack.com/";
+        if (attachment.color && attachment.color.length === 6)
+            attachment.color = '#' +attachment.color;
         if (attachment.image_url && attachment.image_url.startsWith(slackDomainUri)) {
             attachment.remote_image_url = attachment.image_url;
             attachment.image_url = "api/serviceImage?team=" +encodeURIComponent(this.ctx.data.team.id) +"&path=" +encodeURIComponent(attachment.image_url.substr(slackDomainUri.length));

+ 1 - 1
srv/src/template/_templates.js

@@ -3,7 +3,7 @@ const config = require('../../config.js');
 
 module.exports = {
     header: function(title, cssFiles, moreHeader) {
-        var res = `<html><head><title>${title}</title><link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" />`;
+        var res = `<!DOCTYPE HTML5><html><head><title>${title}</title><link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" />`;
         (cssFiles || []).forEach(function(i) {
             if (i[0] === '_') {
                 res += '<style id="' +i.substr(1) +'"></style>';

+ 1 - 0
srv/src/template/index.js

@@ -7,6 +7,7 @@ module.exports.needLogin = function(urlObj) {
 };
 
 module.exports.exec = function(req, res) {
+    res.setHeader('Content-Type', "text/html; charset=UTF-8");
     if (req.account && !req.account.cguReadAndAccepted) {
         if (config.allowNewAccounts)
             return {

+ 1 - 0
srv/src/template/login.js

@@ -160,6 +160,7 @@ module.exports.match = function(url) {
 };
 
 module.exports.exec = function(req, res, srv) {
+    res.setHeader('Content-Type', "text/html; charset=UTF-8");
     if (!req.urlObj.urlParts[1]) {
         if (req.urlObj.queryTokens["native"]) {
             req.session = sessionManager.lazyForRequest(req);