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.
Commit
e1ad499265a23e434f48abcd34949a9ade0df48a8b06f65b597327d60491017a
Parent
c3ed2430cc568cc…
2 files changed
+4
-2
+1
-1
+4
-2
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -151,12 +151,14 @@ | ||
| 151 | 151 | && db_table_exists("repository","chat") |
| 152 | 152 | ){ |
| 153 | 153 | const char *zChatUser = db_get("chat-timeline-user", 0); |
| 154 | 154 | if( zChatUser && zChatUser[0] ){ |
| 155 | 155 | 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," | |
| 158 | 160 | " chat_msg_from_event(type, objid, user, comment)\n" |
| 159 | 161 | " FROM deferred_chat_events;\n", |
| 160 | 162 | zChatUser |
| 161 | 163 | ); |
| 162 | 164 | } |
| 163 | 165 |
| --- 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 @@ | ||
| 571 | 571 | int isWiki = 0; /* True if chat message is x-fossil-wiki */ |
| 572 | 572 | int msgid = atoi(PD("name","0")); |
| 573 | 573 | const int msgBefore = atoi(PD("before","0")); |
| 574 | 574 | int nLimit = msgBefore>0 ? atoi(PD("n","0")) : 0; |
| 575 | 575 | const int bRaw = P("raw")!=0; |
| 576 | - | |
| 576 | + | |
| 577 | 577 | Blob sql = empty_blob; |
| 578 | 578 | Stmt q1; |
| 579 | 579 | nDelay = db_get_int("chat-poll-timeout",420); /* Default about 7 minutes */ |
| 580 | 580 | login_check_credentials(); |
| 581 | 581 | if( !g.perm.Chat ) { |
| 582 | 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 |
| --- 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 |