Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fix misinteraction of the chat send command and the chat search index. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
892dfd2b5510d628c5cfe6c804117fb4 |
| User & Date: | stephan 2024-08-08 12:10:55.386 |
Context
|
2024-08-09
| ||
| 10:32 | Doc touchups in /chat. No code changes. ... (check-in: 7141427370 user: stephan tags: trunk) | |
|
2024-08-08
| ||
| 12:10 | Fix misinteraction of the chat send command and the chat search index. ... (check-in: 892dfd2b55 user: stephan tags: trunk) | |
| 00:28 | The "fossil chat send" mechanism was broken by check-in [fc853823b2218a76] (chat history) because of changes to chat_create_tables(). This fixes the issue. ... (check-in: a913716b4c user: drh tags: trunk) | |
Changes
Changes to src/chat.c.
| ︙ | ︙ | |||
420 421 422 423 424 425 426 |
const char *zMsg;
const char *zUserName;
login_check_credentials();
if( 0==g.perm.Chat ) {
chat_emit_permissions_error(0);
return;
}
| < < < > | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
const char *zMsg;
const char *zUserName;
login_check_credentials();
if( 0==g.perm.Chat ) {
chat_emit_permissions_error(0);
return;
}
zUserName = (g.zLogin && g.zLogin[0]) ? g.zLogin : "nobody";
nByte = atoi(PD("file:bytes","0"));
zMsg = PD("msg","");
db_begin_write();
db_unprotect(PROTECT_READONLY);
chat_create_tables();
chat_purge();
if( nByte==0 ){
if( zMsg[0] ){
db_multi_exec(
"INSERT INTO chat(mtime,lmtime,xfrom,xmsg)"
"VALUES(julianday('now'),%Q,%Q,%Q)",
P("lmtime"), zUserName, zMsg
|
| ︙ | ︙ | |||
451 452 453 454 455 456 457 |
PD("file:mimetype","application/octet-stream"));
blob_init(&b, P("file"), nByte);
db_bind_blob(&q, ":file", &b);
db_step(&q);
db_finalize(&q);
blob_reset(&b);
}
| < > | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
PD("file:mimetype","application/octet-stream"));
blob_init(&b, P("file"), nByte);
db_bind_blob(&q, ":file", &b);
db_step(&q);
db_finalize(&q);
blob_reset(&b);
}
db_commit_transaction();
db_protect_pop();
}
/*
** This routine receives raw (user-entered) message text and
** transforms it into HTML that is safe to insert using innerHTML. As
** of 2021-09-19, it does so by using wiki_convert() or
** markdown_to_html() to convert wiki/markdown-formatted zMsg to HTML.
|
| ︙ | ︙ | |||
1263 1264 1265 1266 1267 1268 1269 |
#ifdef _WIN32
zCmd = mprintf("%s %s/chat?cli &", zBrowser, zUrl);
#else
zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
#endif
fossil_system(zCmd);
}else if( strcmp(g.argv[2],"send")==0 ){
| | | 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 |
#ifdef _WIN32
zCmd = mprintf("%s %s/chat?cli &", zBrowser, zUrl);
#else
zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
#endif
fossil_system(zCmd);
}else if( strcmp(g.argv[2],"send")==0 ){
const char *zFilename = find_option("file","f",1);
const char *zAs = find_option("as",0,1);
const char *zMsg = find_option("message","m",1);
int allowUnsafe = find_option("unsafe",0,0)!=0;
const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS;
int i;
const char *zPw;
char *zLMTime;
|
| ︙ | ︙ |