Fossil SCM

Added lmtime value to chat-timeline-user's chat messages, using the server's local time, to fix time display in the /chat message popup.

stephan 2022-09-15 16:58 trunk
Commit e1ad499265a23e434f48abcd34949a9ade0df48a8b06f65b597327d60491017a
2 files changed +4 -2 +1 -1
+4 -2
--- src/alerts.c
+++ src/alerts.c
@@ -151,12 +151,14 @@
151151
&& db_table_exists("repository","chat")
152152
){
153153
const char *zChatUser = db_get("chat-timeline-user", 0);
154154
if( zChatUser && zChatUser[0] ){
155155
db_multi_exec(
156
- "INSERT INTO chat(mtime,xfrom,xmsg)"
157
- " SELECT julianday(), %Q,"
156
+ "INSERT INTO chat(mtime,lmtime,xfrom,xmsg)"
157
+ " SELECT julianday(), "
158
+ " strftime('%%Y-%%m-%%dT%%H:%%M:%%S','now','localtime'),"
159
+ " %Q,"
158160
" chat_msg_from_event(type, objid, user, comment)\n"
159161
" FROM deferred_chat_events;\n",
160162
zChatUser
161163
);
162164
}
163165
--- src/alerts.c
+++ src/alerts.c
@@ -151,12 +151,14 @@
151 && db_table_exists("repository","chat")
152 ){
153 const char *zChatUser = db_get("chat-timeline-user", 0);
154 if( zChatUser && zChatUser[0] ){
155 db_multi_exec(
156 "INSERT INTO chat(mtime,xfrom,xmsg)"
157 " SELECT julianday(), %Q,"
 
 
158 " chat_msg_from_event(type, objid, user, comment)\n"
159 " FROM deferred_chat_events;\n",
160 zChatUser
161 );
162 }
163
--- src/alerts.c
+++ src/alerts.c
@@ -151,12 +151,14 @@
151 && db_table_exists("repository","chat")
152 ){
153 const char *zChatUser = db_get("chat-timeline-user", 0);
154 if( zChatUser && zChatUser[0] ){
155 db_multi_exec(
156 "INSERT INTO chat(mtime,lmtime,xfrom,xmsg)"
157 " SELECT julianday(), "
158 " strftime('%%Y-%%m-%%dT%%H:%%M:%%S','now','localtime'),"
159 " %Q,"
160 " chat_msg_from_event(type, objid, user, comment)\n"
161 " FROM deferred_chat_events;\n",
162 zChatUser
163 );
164 }
165
+1 -1
--- src/chat.c
+++ src/chat.c
@@ -571,11 +571,11 @@
571571
int isWiki = 0; /* True if chat message is x-fossil-wiki */
572572
int msgid = atoi(PD("name","0"));
573573
const int msgBefore = atoi(PD("before","0"));
574574
int nLimit = msgBefore>0 ? atoi(PD("n","0")) : 0;
575575
const int bRaw = P("raw")!=0;
576
-
576
+
577577
Blob sql = empty_blob;
578578
Stmt q1;
579579
nDelay = db_get_int("chat-poll-timeout",420); /* Default about 7 minutes */
580580
login_check_credentials();
581581
if( !g.perm.Chat ) {
582582
--- src/chat.c
+++ src/chat.c
@@ -571,11 +571,11 @@
571 int isWiki = 0; /* True if chat message is x-fossil-wiki */
572 int msgid = atoi(PD("name","0"));
573 const int msgBefore = atoi(PD("before","0"));
574 int nLimit = msgBefore>0 ? atoi(PD("n","0")) : 0;
575 const int bRaw = P("raw")!=0;
576
577 Blob sql = empty_blob;
578 Stmt q1;
579 nDelay = db_get_int("chat-poll-timeout",420); /* Default about 7 minutes */
580 login_check_credentials();
581 if( !g.perm.Chat ) {
582
--- src/chat.c
+++ src/chat.c
@@ -571,11 +571,11 @@
571 int isWiki = 0; /* True if chat message is x-fossil-wiki */
572 int msgid = atoi(PD("name","0"));
573 const int msgBefore = atoi(PD("before","0"));
574 int nLimit = msgBefore>0 ? atoi(PD("n","0")) : 0;
575 const int bRaw = P("raw")!=0;
576
577 Blob sql = empty_blob;
578 Stmt q1;
579 nDelay = db_get_int("chat-poll-timeout",420); /* Default about 7 minutes */
580 login_check_credentials();
581 if( !g.perm.Chat ) {
582

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button