1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-30 04:14:47 +01:00

- posting on chats works;

- fixed ordering  in db:all-chat-messages (message-id was  not a valid
  column name);
- added scheduled events;
- minor changes in labels.
This commit is contained in:
cage 2020-09-06 14:42:16 +02:00
parent c5118d46a6
commit b2b3e65431
13 changed files with 313 additions and 176 deletions

164
po/it.po
View File

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tinmop 0.0.1\n" "Project-Id-Version: tinmop 0.0.1\n"
"Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n" "Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n"
"POT-Creation-Date: 2020-09-05 17:03+0200\n" "POT-Creation-Date: 2020-09-06 12:27+0200\n"
"PO-Revision-Date: 2020-09-05 17:07+0200\n" "PO-Revision-Date: 2020-09-06 12:28+0200\n"
"Last-Translator: cage <cage@invalid.org>\n" "Last-Translator: cage <cage@invalid.org>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"Language: it\n" "Language: it\n"
@ -80,8 +80,8 @@ msgstr "~@[~a~]~@[~a~] ~a non letti: ~a"
#: src/chats-list-window.lisp:64 #: src/chats-list-window.lisp:64
#, lisp-format #, lisp-format
msgid "~a ~a said:~%~a ~a~2%" msgid "~a ~a wrote:~%~a ~a~2%"
msgstr "\"~a ~a ha detto:~%~a ~a~2%\"" msgstr "~a ~a ha scritto:~%~a ~a~2%"
#: src/chats-list-window.lisp:102 #: src/chats-list-window.lisp:102
msgid "Current chats" msgid "Current chats"
@ -302,12 +302,12 @@ msgstr "Mappa tasti globale"
msgid "Quick help" msgid "Quick help"
msgstr "Aiuto rapido" msgstr "Aiuto rapido"
#: src/line-oriented-window.lisp:304 src/ui-goodies.lisp:77 #: src/line-oriented-window.lisp:305 src/ui-goodies.lisp:77
#: src/ui-goodies.lisp:94 #: src/ui-goodies.lisp:94
msgid "Information" msgid "Information"
msgstr "Informazione" msgstr "Informazione"
#: src/main.lisp:78 #: src/main.lisp:85
#, lisp-format #, lisp-format
msgid "Folder ~s does not exists" msgid "Folder ~s does not exists"
msgstr "La cartella ~s non esiste." msgstr "La cartella ~s non esiste."
@ -395,7 +395,7 @@ msgstr "È ammessa una sola scelta"
msgid "The poll has expired" msgid "The poll has expired"
msgstr "Il sondaggio è scaduto" msgstr "Il sondaggio è scaduto"
#: src/message-window.lisp:242 #: src/message-window.lisp:260
msgid "Messages" msgid "Messages"
msgstr "Messaggi" msgstr "Messaggi"
@ -634,333 +634,333 @@ msgstr "Il focus è passato alla finestra dei flussi di dati gemini."
msgid "Focus passed on chats list window" msgid "Focus passed on chats list window"
msgstr "Il focus è passato alla finestra delle chat." msgstr "Il focus è passato alla finestra delle chat."
#: src/ui-goodies.lisp:505 #: src/ui-goodies.lisp:504
#, lisp-format #, lisp-format
msgid "Saving messages in ~s" msgid "Saving messages in ~s"
msgstr "Salvo i messaggi in ~s" msgstr "Salvo i messaggi in ~s"
#: src/ui-goodies.lisp:506 #: src/ui-goodies.lisp:505
#, lisp-format #, lisp-format
msgid "Saved message in ~s" msgid "Saved message in ~s"
msgstr "Salvati i messaggi in ~s" msgstr "Salvati i messaggi in ~s"
#: src/ui-goodies.lisp:509 src/ui-goodies.lisp:527 #: src/ui-goodies.lisp:508 src/ui-goodies.lisp:526
msgid "No folder specified." msgid "No folder specified."
msgstr "Nessuna cartella indicata." msgstr "Nessuna cartella indicata."
#: src/ui-goodies.lisp:511 #: src/ui-goodies.lisp:510
msgid "Move to folder: " msgid "Move to folder: "
msgstr "Sposta nella cartella: " msgstr "Sposta nella cartella: "
#: src/ui-goodies.lisp:525 #: src/ui-goodies.lisp:524
#, lisp-format #, lisp-format
msgid "Folder ~s does not exists." msgid "Folder ~s does not exists."
msgstr "La cartella ~s non esiste." msgstr "La cartella ~s non esiste."
#: src/ui-goodies.lisp:529 #: src/ui-goodies.lisp:528
msgid "Change folder: " msgid "Change folder: "
msgstr "Spostati nella cartella: " msgstr "Spostati nella cartella: "
#: src/ui-goodies.lisp:540 #: src/ui-goodies.lisp:539
msgid "No timeline specified." msgid "No timeline specified."
msgstr "Nessuna timeline indicata." msgstr "Nessuna timeline indicata."
#: src/ui-goodies.lisp:542 #: src/ui-goodies.lisp:541
msgid "This timeline is protected." msgid "This timeline is protected."
msgstr "Questa timeline è protetta." msgstr "Questa timeline è protetta."
#: src/ui-goodies.lisp:546 #: src/ui-goodies.lisp:545
msgid "Change timeline: " msgid "Change timeline: "
msgstr "Spostati nella timeline: " msgstr "Spostati nella timeline: "
#: src/ui-goodies.lisp:562 #: src/ui-goodies.lisp:561
msgid "Downloading messages." msgid "Downloading messages."
msgstr "Scarico i messaggi." msgstr "Scarico i messaggi."
#: src/ui-goodies.lisp:566 src/ui-goodies.lisp:660 #: src/ui-goodies.lisp:565 src/ui-goodies.lisp:659
msgid "Messages downloaded." msgid "Messages downloaded."
msgstr "Messaggi scaricati" msgstr "Messaggi scaricati"
#: src/ui-goodies.lisp:639 #: src/ui-goodies.lisp:638
msgid "Expanding thread" msgid "Expanding thread"
msgstr "Espandi l'albero dei messaggi" msgstr "Espandi l'albero dei messaggi"
#: src/ui-goodies.lisp:659 #: src/ui-goodies.lisp:658
msgid "Downloading tags messages." msgid "Downloading tags messages."
msgstr "Scarico i messaggi dell'etichetta." msgstr "Scarico i messaggi dell'etichetta."
#: src/ui-goodies.lisp:672 #: src/ui-goodies.lisp:671
msgid "Favorite this message?" msgid "Favorite this message?"
msgstr "Conservare tra i favoriti questo messaggio?" msgstr "Conservare tra i favoriti questo messaggio?"
#: src/ui-goodies.lisp:681 #: src/ui-goodies.lisp:680
msgid "Favouring message." msgid "Favouring message."
msgstr "Conservo il messaggio tra i favoriti." msgstr "Conservo il messaggio tra i favoriti."
#: src/ui-goodies.lisp:682 #: src/ui-goodies.lisp:681
msgid "Favoured message." msgid "Favoured message."
msgstr "Messaggio conservato tra i favoriti." msgstr "Messaggio conservato tra i favoriti."
#: src/ui-goodies.lisp:687 #: src/ui-goodies.lisp:686
msgid "Remove this message from your favourites?" msgid "Remove this message from your favourites?"
msgstr "Rimuovere dai preferiti questo messaggio?" msgstr "Rimuovere dai preferiti questo messaggio?"
#: src/ui-goodies.lisp:696 #: src/ui-goodies.lisp:695
msgid "Unfavouring message." msgid "Unfavouring message."
msgstr "Rimuovo messaggio dai favoriti." msgstr "Rimuovo messaggio dai favoriti."
#: src/ui-goodies.lisp:697 #: src/ui-goodies.lisp:696
msgid "Unfavoured message." msgid "Unfavoured message."
msgstr "Rimuosso messaggio dai favoriti." msgstr "Rimuosso messaggio dai favoriti."
#: src/ui-goodies.lisp:702 #: src/ui-goodies.lisp:701
msgid "Boost this message?" msgid "Boost this message?"
msgstr "Rilancia questo messaggio?" msgstr "Rilancia questo messaggio?"
#: src/ui-goodies.lisp:711 #: src/ui-goodies.lisp:710
msgid "Boosting message." msgid "Boosting message."
msgstr "Rilancio il messaggio." msgstr "Rilancio il messaggio."
#: src/ui-goodies.lisp:712 #: src/ui-goodies.lisp:711
msgid "Boosted message." msgid "Boosted message."
msgstr "Messaggio rilanciato." msgstr "Messaggio rilanciato."
#: src/ui-goodies.lisp:717 #: src/ui-goodies.lisp:716
msgid "Unboost this message?" msgid "Unboost this message?"
msgstr "Ritira il rilancio del messaggio?" msgstr "Ritira il rilancio del messaggio?"
#: src/ui-goodies.lisp:726 #: src/ui-goodies.lisp:725
msgid "Uboosting message." msgid "Uboosting message."
msgstr "Ritiro il rilancio del messaggio." msgstr "Ritiro il rilancio del messaggio."
#: src/ui-goodies.lisp:727 #: src/ui-goodies.lisp:726
msgid "Unboosted message." msgid "Unboosted message."
msgstr "Ritirato il rilancio del messaggio." msgstr "Ritirato il rilancio del messaggio."
#: src/ui-goodies.lisp:735 #: src/ui-goodies.lisp:734
#, lisp-format #, lisp-format
msgid "Ignore ~s?" msgid "Ignore ~s?"
msgstr "Ignorare ~s?" msgstr "Ignorare ~s?"
#: src/ui-goodies.lisp:738 #: src/ui-goodies.lisp:737
#, lisp-format #, lisp-format
msgid "Ignoring ~s" msgid "Ignoring ~s"
msgstr "Ignoro ~s" msgstr "Ignoro ~s"
#: src/ui-goodies.lisp:739 #: src/ui-goodies.lisp:738
#, lisp-format #, lisp-format
msgid "User ~s ignored" msgid "User ~s ignored"
msgstr "Utente ~s ignorato" msgstr "Utente ~s ignorato"
#: src/ui-goodies.lisp:749 #: src/ui-goodies.lisp:748
msgid "No username specified." msgid "No username specified."
msgstr "Nessun nome utente indicato." msgstr "Nessun nome utente indicato."
#: src/ui-goodies.lisp:751 #: src/ui-goodies.lisp:750
msgid "Unignore username: " msgid "Unignore username: "
msgstr "Riprendere a leggere i messaggi di:" msgstr "Riprendere a leggere i messaggi di:"
#: src/ui-goodies.lisp:780 #: src/ui-goodies.lisp:779
#, lisp-format #, lisp-format
msgid "File ~s does not exists." msgid "File ~s does not exists."
msgstr "Il file ~s non esiste." msgstr "Il file ~s non esiste."
#: src/ui-goodies.lisp:782 #: src/ui-goodies.lisp:781
msgid "Message ready to be sent" msgid "Message ready to be sent"
msgstr "Messaggio pronto per essere spedito" msgstr "Messaggio pronto per essere spedito"
#: src/ui-goodies.lisp:784 #: src/ui-goodies.lisp:783
msgid "Add attachment: " msgid "Add attachment: "
msgstr "Aggiungi allegato: " msgstr "Aggiungi allegato: "
#: src/ui-goodies.lisp:794 #: src/ui-goodies.lisp:793
msgid "New subject: " msgid "New subject: "
msgstr "Nuovo oggetto del messaggio: " msgstr "Nuovo oggetto del messaggio: "
#: src/ui-goodies.lisp:803 #: src/ui-goodies.lisp:802
msgid "New visibility: " msgid "New visibility: "
msgstr "Nuovo livello di visibilità: " msgstr "Nuovo livello di visibilità: "
#: src/ui-goodies.lisp:856 #: src/ui-goodies.lisp:855
#, lisp-format #, lisp-format
msgid "Your message is ~a character too long." msgid "Your message is ~a character too long."
msgid_plural "Your message is ~a characters too long." msgid_plural "Your message is ~a characters too long."
msgstr[0] "Il tuo messaggio e più lungo del limite ammesso di ~a carattere." msgstr[0] "Il tuo messaggio e più lungo del limite ammesso di ~a carattere."
msgstr[1] "Il tuo messaggio e più lungo del limite ammesso di ~a caratteri." msgstr[1] "Il tuo messaggio e più lungo del limite ammesso di ~a caratteri."
#: src/ui-goodies.lisp:880 #: src/ui-goodies.lisp:879
msgid "Add subject: " msgid "Add subject: "
msgstr "Oggetto del messaggio: " msgstr "Oggetto del messaggio: "
#: src/ui-goodies.lisp:960 #: src/ui-goodies.lisp:959
#, lisp-format #, lisp-format
msgid "The maximum allowed number of media is ~a." msgid "The maximum allowed number of media is ~a."
msgstr "Il numero massimo di file da allegare è ~a." msgstr "Il numero massimo di file da allegare è ~a."
#: src/ui-goodies.lisp:963 #: src/ui-goodies.lisp:962
msgid "Sending message" msgid "Sending message"
msgstr "Spedisco il messaggio" msgstr "Spedisco il messaggio"
#: src/ui-goodies.lisp:1054 #: src/ui-goodies.lisp:1053
msgid "Follow: " msgid "Follow: "
msgstr "Segui: " msgstr "Segui: "
#: src/ui-goodies.lisp:1057 #: src/ui-goodies.lisp:1056
#, lisp-format #, lisp-format
msgid "Following ~a" msgid "Following ~a"
msgstr "Segui ~a" msgstr "Segui ~a"
#: src/ui-goodies.lisp:1058 #: src/ui-goodies.lisp:1057
#, lisp-format #, lisp-format
msgid "Followed ~a" msgid "Followed ~a"
msgstr "Adesso segui ~a " msgstr "Adesso segui ~a "
#: src/ui-goodies.lisp:1062 #: src/ui-goodies.lisp:1061
msgid "Unfollow: " msgid "Unfollow: "
msgstr "Abbandona: " msgstr "Abbandona: "
#: src/ui-goodies.lisp:1065 #: src/ui-goodies.lisp:1064
#, lisp-format #, lisp-format
msgid "Unfollowing ~a" msgid "Unfollowing ~a"
msgstr "Abbandona ~a" msgstr "Abbandona ~a"
#: src/ui-goodies.lisp:1066 #: src/ui-goodies.lisp:1065
#, lisp-format #, lisp-format
msgid "Unfollowed ~a" msgid "Unfollowed ~a"
msgstr "Hai abbandonato ~a" msgstr "Hai abbandonato ~a"
#: src/ui-goodies.lisp:1095 #: src/ui-goodies.lisp:1094
msgid "Confirm operation?" msgid "Confirm operation?"
msgstr "Confermi l'operazione?" msgstr "Confermi l'operazione?"
#: src/ui-goodies.lisp:1133 #: src/ui-goodies.lisp:1132
msgid "Updating conversations." msgid "Updating conversations."
msgstr "Aggiorno le conversazioni" msgstr "Aggiorno le conversazioni"
#: src/ui-goodies.lisp:1134 #: src/ui-goodies.lisp:1133
msgid "Conversations updated." msgid "Conversations updated."
msgstr "Conversazioni aggiornate" msgstr "Conversazioni aggiornate"
#: src/ui-goodies.lisp:1144 #: src/ui-goodies.lisp:1143
msgid "Open conversation: " msgid "Open conversation: "
msgstr "Apri una conversazione: " msgstr "Apri una conversazione: "
#: src/ui-goodies.lisp:1179 #: src/ui-goodies.lisp:1178
msgid "Old name: " msgid "Old name: "
msgstr "Nome precedente: " msgstr "Nome precedente: "
#: src/ui-goodies.lisp:1193 #: src/ui-goodies.lisp:1192
#, lisp-format #, lisp-format
msgid "A conversation with name ~a already exists." msgid "A conversation with name ~a already exists."
msgstr "Una conversazione con nome ~a esiste già." msgstr "Una conversazione con nome ~a esiste già."
#: src/ui-goodies.lisp:1199 #: src/ui-goodies.lisp:1198
msgid "New name: " msgid "New name: "
msgstr "Nuovo nome: " msgstr "Nuovo nome: "
#: src/ui-goodies.lisp:1215 #: src/ui-goodies.lisp:1214
#, lisp-format #, lisp-format
msgid "Ignore conversation ~s? [y/N] " msgid "Ignore conversation ~s? [y/N] "
msgstr "Ignorare la conversazione ~s? [s/N] " msgstr "Ignorare la conversazione ~s? [s/N] "
#: src/ui-goodies.lisp:1231 #: src/ui-goodies.lisp:1230
#, lisp-format #, lisp-format
msgid "Delete conversation ~s? [y/N] " msgid "Delete conversation ~s? [y/N] "
msgstr "Eliminare la conversazione ~s? [s/N] " msgstr "Eliminare la conversazione ~s? [s/N] "
#: src/ui-goodies.lisp:1250 #: src/ui-goodies.lisp:1249
#, lisp-format #, lisp-format
msgid "Comment too long by ~a character" msgid "Comment too long by ~a character"
msgid_plural "Comment too long by ~a characters" msgid_plural "Comment too long by ~a characters"
msgstr[0] "Il commento è troppo lungo di ~a caratteri" msgstr[0] "Il commento è troppo lungo di ~a caratteri"
msgstr[1] "Il commento è troppo lungo di ~a caratteri" msgstr[1] "Il commento è troppo lungo di ~a caratteri"
#: src/ui-goodies.lisp:1257 #: src/ui-goodies.lisp:1256
#, lisp-format #, lisp-format
msgid "Reporting user: ~s" msgid "Reporting user: ~s"
msgstr "Segnalo l'utente ~s" msgstr "Segnalo l'utente ~s"
#: src/ui-goodies.lisp:1258 #: src/ui-goodies.lisp:1257
msgid "Report trasmitted." msgid "Report trasmitted."
msgstr "Segnalazione trasmessa." msgstr "Segnalazione trasmessa."
#: src/ui-goodies.lisp:1261 #: src/ui-goodies.lisp:1260
msgid "Comment on reports: " msgid "Comment on reports: "
msgstr "Commento sulla segnalazione: " msgstr "Commento sulla segnalazione: "
#: src/ui-goodies.lisp:1277 src/ui-goodies.lisp:1310 src/ui-goodies.lisp:1328 #: src/ui-goodies.lisp:1276 src/ui-goodies.lisp:1309 src/ui-goodies.lisp:1327
#, lisp-format #, lisp-format
msgid "User ~s does not exists in database" msgid "User ~s does not exists in database"
msgstr "L'utente ~s non esiste nel database" msgstr "L'utente ~s non esiste nel database"
#: src/ui-goodies.lisp:1280 src/ui-goodies.lisp:1313 src/ui-goodies.lisp:1331 #: src/ui-goodies.lisp:1279 src/ui-goodies.lisp:1312 src/ui-goodies.lisp:1330
msgid "Username: " msgid "Username: "
msgstr "Nome utente: " msgstr "Nome utente: "
#: src/ui-goodies.lisp:1290 #: src/ui-goodies.lisp:1289
#, lisp-format #, lisp-format
msgid "Added crypto key for user ~s" msgid "Added crypto key for user ~s"
msgstr "Aggiunta chiave crittografica per l'utente ~s" msgstr "Aggiunta chiave crittografica per l'utente ~s"
#: src/ui-goodies.lisp:1293 #: src/ui-goodies.lisp:1292
msgid "Key: " msgid "Key: "
msgstr "Chiave: " msgstr "Chiave: "
#: src/ui-goodies.lisp:1307 #: src/ui-goodies.lisp:1306
#, lisp-format #, lisp-format
msgid "Generated key for user ~s" msgid "Generated key for user ~s"
msgstr "Generata chiave crittografica per l'utente ~s" msgstr "Generata chiave crittografica per l'utente ~s"
#: src/ui-goodies.lisp:1308 #: src/ui-goodies.lisp:1307
#, lisp-format #, lisp-format
msgid "user ~s key ~s" msgid "user ~s key ~s"
msgstr "utente ~s chiave ~s" msgstr "utente ~s chiave ~s"
#: src/ui-goodies.lisp:1324 #: src/ui-goodies.lisp:1323
#, lisp-format #, lisp-format
msgid "Added key for user ~s: ~a" msgid "Added key for user ~s: ~a"
msgstr "Aggiunta chiave crittografica per l'utente ~s: ~a" msgstr "Aggiunta chiave crittografica per l'utente ~s: ~a"
#: src/ui-goodies.lisp:1341 #: src/ui-goodies.lisp:1340
msgid "About this software" msgid "About this software"
msgstr "Sul programma" msgstr "Sul programma"
#: src/ui-goodies.lisp:1353 #: src/ui-goodies.lisp:1352
msgid "Clearing pagination data" msgid "Clearing pagination data"
msgstr "Elimina i dati della paginazione" msgstr "Elimina i dati della paginazione"
#: src/ui-goodies.lisp:1372 #: src/ui-goodies.lisp:1371
msgid "Invalid choices, usa a space separated list of positive integers." msgid "Invalid choices, usa a space separated list of positive integers."
msgstr "" msgstr ""
"Il formato ammesso è costituito da una lista di interi positivi separati da " "Il formato ammesso è costituito da una lista di interi positivi separati da "
"spazi." "spazi."
#: src/ui-goodies.lisp:1389 #: src/ui-goodies.lisp:1388
#, lisp-format #, lisp-format
msgid "Invalid choices, index choice out of range (max ~a)." msgid "Invalid choices, index choice out of range (max ~a)."
msgstr "Intervallo dei valori delle scelte non valido (massimo ~a)." msgstr "Intervallo dei valori delle scelte non valido (massimo ~a)."
#: src/ui-goodies.lisp:1391 #: src/ui-goodies.lisp:1390
msgid "Voting... " msgid "Voting... "
msgstr "Votazione in corso..." msgstr "Votazione in corso..."
#: src/ui-goodies.lisp:1392 #: src/ui-goodies.lisp:1391
msgid "Choice sent." msgid "Choice sent."
msgstr "Voto inserito." msgstr "Voto inserito."
#: src/ui-goodies.lisp:1401 #: src/ui-goodies.lisp:1400
msgid "Type the index (or space separated indices) of selected choices: " msgid "Type the index (or space separated indices) of selected choices: "
msgstr "Inserisci gli indici associati alle opzioni separati da spazi: " msgstr "Inserisci gli indici associati alle opzioni separati da spazi: "
#: src/ui-goodies.lisp:1402 #: src/ui-goodies.lisp:1401
msgid "This in not a poll" msgid "This in not a poll"
msgstr "Questo messaggio non è un sondaggio." msgstr "Questo messaggio non è un sondaggio."
#: src/ui-goodies.lisp:1451 #: src/ui-goodies.lisp:1452
msgid "This is not a valid gemini address" msgid "This is not a valid gemini address"
msgstr "Questo non è un indirizzo gemini valido" msgstr "Questo non è un indirizzo gemini valido"
#: src/ui-goodies.lisp:1452 #: src/ui-goodies.lisp:1453
msgid "Open Gemini url: " msgid "Open Gemini url: "
msgstr "Apri un indirizzo gemini: " msgstr "Apri un indirizzo gemini: "

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tinmop 0.1.8\n" "Project-Id-Version: tinmop 0.1.8\n"
"Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n" "Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n"
"POT-Creation-Date: 2020-09-05 17:03+0200\n" "POT-Creation-Date: 2020-09-06 12:27+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -76,7 +76,7 @@ msgstr ""
#: src/chats-list-window.lisp:64 #: src/chats-list-window.lisp:64
#, lisp-format #, lisp-format
msgid "~a ~a said:~%~a ~a~2%" msgid "~a ~a wrote:~%~a ~a~2%"
msgstr "" msgstr ""
#: src/chats-list-window.lisp:102 #: src/chats-list-window.lisp:102
@ -291,12 +291,12 @@ msgstr ""
msgid "Quick help" msgid "Quick help"
msgstr "" msgstr ""
#: src/line-oriented-window.lisp:304 src/ui-goodies.lisp:77 #: src/line-oriented-window.lisp:305 src/ui-goodies.lisp:77
#: src/ui-goodies.lisp:94 #: src/ui-goodies.lisp:94
msgid "Information" msgid "Information"
msgstr "" msgstr ""
#: src/main.lisp:78 #: src/main.lisp:85
#, lisp-format #, lisp-format
msgid "Folder ~s does not exists" msgid "Folder ~s does not exists"
msgstr "" msgstr ""
@ -384,7 +384,7 @@ msgstr ""
msgid "The poll has expired" msgid "The poll has expired"
msgstr "" msgstr ""
#: src/message-window.lisp:242 #: src/message-window.lisp:260
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
@ -617,331 +617,331 @@ msgstr ""
msgid "Focus passed on chats list window" msgid "Focus passed on chats list window"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:505 #: src/ui-goodies.lisp:504
#, lisp-format #, lisp-format
msgid "Saving messages in ~s" msgid "Saving messages in ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:506 #: src/ui-goodies.lisp:505
#, lisp-format #, lisp-format
msgid "Saved message in ~s" msgid "Saved message in ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:509 src/ui-goodies.lisp:527 #: src/ui-goodies.lisp:508 src/ui-goodies.lisp:526
msgid "No folder specified." msgid "No folder specified."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:511 #: src/ui-goodies.lisp:510
msgid "Move to folder: " msgid "Move to folder: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:525 #: src/ui-goodies.lisp:524
#, lisp-format #, lisp-format
msgid "Folder ~s does not exists." msgid "Folder ~s does not exists."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:529 #: src/ui-goodies.lisp:528
msgid "Change folder: " msgid "Change folder: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:540 #: src/ui-goodies.lisp:539
msgid "No timeline specified." msgid "No timeline specified."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:542 #: src/ui-goodies.lisp:541
msgid "This timeline is protected." msgid "This timeline is protected."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:546 #: src/ui-goodies.lisp:545
msgid "Change timeline: " msgid "Change timeline: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:562 #: src/ui-goodies.lisp:561
msgid "Downloading messages." msgid "Downloading messages."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:566 src/ui-goodies.lisp:660 #: src/ui-goodies.lisp:565 src/ui-goodies.lisp:659
msgid "Messages downloaded." msgid "Messages downloaded."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:639 #: src/ui-goodies.lisp:638
msgid "Expanding thread" msgid "Expanding thread"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:659 #: src/ui-goodies.lisp:658
msgid "Downloading tags messages." msgid "Downloading tags messages."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:672 #: src/ui-goodies.lisp:671
msgid "Favorite this message?" msgid "Favorite this message?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:681 #: src/ui-goodies.lisp:680
msgid "Favouring message." msgid "Favouring message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:682 #: src/ui-goodies.lisp:681
msgid "Favoured message." msgid "Favoured message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:687 #: src/ui-goodies.lisp:686
msgid "Remove this message from your favourites?" msgid "Remove this message from your favourites?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:696 #: src/ui-goodies.lisp:695
msgid "Unfavouring message." msgid "Unfavouring message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:697 #: src/ui-goodies.lisp:696
msgid "Unfavoured message." msgid "Unfavoured message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:702 #: src/ui-goodies.lisp:701
msgid "Boost this message?" msgid "Boost this message?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:711 #: src/ui-goodies.lisp:710
msgid "Boosting message." msgid "Boosting message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:712 #: src/ui-goodies.lisp:711
msgid "Boosted message." msgid "Boosted message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:717 #: src/ui-goodies.lisp:716
msgid "Unboost this message?" msgid "Unboost this message?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:726 #: src/ui-goodies.lisp:725
msgid "Uboosting message." msgid "Uboosting message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:727 #: src/ui-goodies.lisp:726
msgid "Unboosted message." msgid "Unboosted message."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:735 #: src/ui-goodies.lisp:734
#, lisp-format #, lisp-format
msgid "Ignore ~s?" msgid "Ignore ~s?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:738 #: src/ui-goodies.lisp:737
#, lisp-format #, lisp-format
msgid "Ignoring ~s" msgid "Ignoring ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:739 #: src/ui-goodies.lisp:738
#, lisp-format #, lisp-format
msgid "User ~s ignored" msgid "User ~s ignored"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:749 #: src/ui-goodies.lisp:748
msgid "No username specified." msgid "No username specified."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:751 #: src/ui-goodies.lisp:750
msgid "Unignore username: " msgid "Unignore username: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:780 #: src/ui-goodies.lisp:779
#, lisp-format #, lisp-format
msgid "File ~s does not exists." msgid "File ~s does not exists."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:782 #: src/ui-goodies.lisp:781
msgid "Message ready to be sent" msgid "Message ready to be sent"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:784 #: src/ui-goodies.lisp:783
msgid "Add attachment: " msgid "Add attachment: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:794 #: src/ui-goodies.lisp:793
msgid "New subject: " msgid "New subject: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:803 #: src/ui-goodies.lisp:802
msgid "New visibility: " msgid "New visibility: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:856 #: src/ui-goodies.lisp:855
#, lisp-format #, lisp-format
msgid "Your message is ~a character too long." msgid "Your message is ~a character too long."
msgid_plural "Your message is ~a characters too long." msgid_plural "Your message is ~a characters too long."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/ui-goodies.lisp:880 #: src/ui-goodies.lisp:879
msgid "Add subject: " msgid "Add subject: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:960 #: src/ui-goodies.lisp:959
#, lisp-format #, lisp-format
msgid "The maximum allowed number of media is ~a." msgid "The maximum allowed number of media is ~a."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:963 #: src/ui-goodies.lisp:962
msgid "Sending message" msgid "Sending message"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1054 #: src/ui-goodies.lisp:1053
msgid "Follow: " msgid "Follow: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1057 #: src/ui-goodies.lisp:1056
#, lisp-format #, lisp-format
msgid "Following ~a" msgid "Following ~a"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1058 #: src/ui-goodies.lisp:1057
#, lisp-format #, lisp-format
msgid "Followed ~a" msgid "Followed ~a"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1062 #: src/ui-goodies.lisp:1061
msgid "Unfollow: " msgid "Unfollow: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1065 #: src/ui-goodies.lisp:1064
#, lisp-format #, lisp-format
msgid "Unfollowing ~a" msgid "Unfollowing ~a"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1066 #: src/ui-goodies.lisp:1065
#, lisp-format #, lisp-format
msgid "Unfollowed ~a" msgid "Unfollowed ~a"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1095 #: src/ui-goodies.lisp:1094
msgid "Confirm operation?" msgid "Confirm operation?"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1133 #: src/ui-goodies.lisp:1132
msgid "Updating conversations." msgid "Updating conversations."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1134 #: src/ui-goodies.lisp:1133
msgid "Conversations updated." msgid "Conversations updated."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1144 #: src/ui-goodies.lisp:1143
msgid "Open conversation: " msgid "Open conversation: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1179 #: src/ui-goodies.lisp:1178
msgid "Old name: " msgid "Old name: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1193 #: src/ui-goodies.lisp:1192
#, lisp-format #, lisp-format
msgid "A conversation with name ~a already exists." msgid "A conversation with name ~a already exists."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1199 #: src/ui-goodies.lisp:1198
msgid "New name: " msgid "New name: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1215 #: src/ui-goodies.lisp:1214
#, lisp-format #, lisp-format
msgid "Ignore conversation ~s? [y/N] " msgid "Ignore conversation ~s? [y/N] "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1231 #: src/ui-goodies.lisp:1230
#, lisp-format #, lisp-format
msgid "Delete conversation ~s? [y/N] " msgid "Delete conversation ~s? [y/N] "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1250 #: src/ui-goodies.lisp:1249
#, lisp-format #, lisp-format
msgid "Comment too long by ~a character" msgid "Comment too long by ~a character"
msgid_plural "Comment too long by ~a characters" msgid_plural "Comment too long by ~a characters"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/ui-goodies.lisp:1257 #: src/ui-goodies.lisp:1256
#, lisp-format #, lisp-format
msgid "Reporting user: ~s" msgid "Reporting user: ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1258 #: src/ui-goodies.lisp:1257
msgid "Report trasmitted." msgid "Report trasmitted."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1261 #: src/ui-goodies.lisp:1260
msgid "Comment on reports: " msgid "Comment on reports: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1277 src/ui-goodies.lisp:1310 src/ui-goodies.lisp:1328 #: src/ui-goodies.lisp:1276 src/ui-goodies.lisp:1309 src/ui-goodies.lisp:1327
#, lisp-format #, lisp-format
msgid "User ~s does not exists in database" msgid "User ~s does not exists in database"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1280 src/ui-goodies.lisp:1313 src/ui-goodies.lisp:1331 #: src/ui-goodies.lisp:1279 src/ui-goodies.lisp:1312 src/ui-goodies.lisp:1330
msgid "Username: " msgid "Username: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1290 #: src/ui-goodies.lisp:1289
#, lisp-format #, lisp-format
msgid "Added crypto key for user ~s" msgid "Added crypto key for user ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1293 #: src/ui-goodies.lisp:1292
msgid "Key: " msgid "Key: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1307 #: src/ui-goodies.lisp:1306
#, lisp-format #, lisp-format
msgid "Generated key for user ~s" msgid "Generated key for user ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1308 #: src/ui-goodies.lisp:1307
#, lisp-format #, lisp-format
msgid "user ~s key ~s" msgid "user ~s key ~s"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1324 #: src/ui-goodies.lisp:1323
#, lisp-format #, lisp-format
msgid "Added key for user ~s: ~a" msgid "Added key for user ~s: ~a"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1341 #: src/ui-goodies.lisp:1340
msgid "About this software" msgid "About this software"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1353 #: src/ui-goodies.lisp:1352
msgid "Clearing pagination data" msgid "Clearing pagination data"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1372 #: src/ui-goodies.lisp:1371
msgid "Invalid choices, usa a space separated list of positive integers." msgid "Invalid choices, usa a space separated list of positive integers."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1389 #: src/ui-goodies.lisp:1388
#, lisp-format #, lisp-format
msgid "Invalid choices, index choice out of range (max ~a)." msgid "Invalid choices, index choice out of range (max ~a)."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1391 #: src/ui-goodies.lisp:1390
msgid "Voting... " msgid "Voting... "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1392 #: src/ui-goodies.lisp:1391
msgid "Choice sent." msgid "Choice sent."
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1401 #: src/ui-goodies.lisp:1400
msgid "Type the index (or space separated indices) of selected choices: " msgid "Type the index (or space separated indices) of selected choices: "
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1402 #: src/ui-goodies.lisp:1401
msgid "This in not a poll" msgid "This in not a poll"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1451 #: src/ui-goodies.lisp:1452
msgid "This is not a valid gemini address" msgid "This is not a valid gemini address"
msgstr "" msgstr ""
#: src/ui-goodies.lisp:1452 #: src/ui-goodies.lisp:1453
msgid "Open Gemini url: " msgid "Open Gemini url: "
msgstr "" msgstr ""

View File

@ -46,7 +46,10 @@
(defun post-chat-path (chat-id) (defun post-chat-path (chat-id)
(format nil "/api/v1/pleroma/chats/~a/messages" chat-id)) (format nil "/api/v1/pleroma/chats/~a/messages" chat-id))
(defmethod post-chat-message ((object tooter:client) (chat-id string) (content string) (media null)) (defmethod post-chat-message ((object tooter:client)
(chat-id string)
(content string)
(media null))
"Post a message to chat identified by `chat-id' with text `content` or "Post a message to chat identified by `chat-id' with text `content` or
media `media'." media `media'."
(decode-chat-message (tooter:submit object (decode-chat-message (tooter:submit object
@ -54,7 +57,10 @@ media `media'."
:content content :content content
:media-id media))) :media-id media)))
(defmethod post-chat-message ((object tooter:client) (chat-id string) (content null) (media string)) (defmethod post-chat-message ((object tooter:client)
(chat-id string)
(content null)
(media string))
"Post a message to chat identified by `chat-id' with text `content` or "Post a message to chat identified by `chat-id' with text `content` or
media `media'. Returns a `chat-message' instance" media `media'. Returns a `chat-message' instance"
(let ((path-media (fs:namestring->pathname media))) (let ((path-media (fs:namestring->pathname media)))
@ -90,3 +96,9 @@ media `media'. Returns a `chat-message' instance"
(defun-w-lock get-chats () (defun-w-lock get-chats ()
api-client:*client-lock* api-client:*client-lock*
(get-all-chats api-client:*client*)) (get-all-chats api-client:*client*))
(defun-w-lock post-on-chat (chat-id message)
api-client:*client-lock*
(if (cl-ppcre:scan "^/" message)
(api-pleroma:post-chat-message api-client:*client* chat-id nil message)
(api-pleroma:post-chat-message api-client:*client* chat-id message nil)))

View File

@ -61,7 +61,7 @@
"")) ""))
(username (db:user-id->username (db:row-account-id message)))) (username (db:user-id->username (db:row-account-id message))))
(format stream (format stream
(_ "~a ~a said:~%~a ~a~2%") (_ "~a ~a wrote:~%~a ~a~2%")
formatted-created-date formatted-created-date
username username
content content

View File

@ -157,3 +157,7 @@ list af all possible candidtae for completion."
(when-let ((matched (remove-if-not (starts-with-clsr hint) (when-let ((matched (remove-if-not (starts-with-clsr hint)
(funcall #'db:history-prompt->values prompt)))) (funcall #'db:history-prompt->values prompt))))
(values matched (reduce-to-common-prefix matched))))) (values matched (reduce-to-common-prefix matched)))))
(defun complete-chat-message (hint)
(append (username-complete hint)
(directory-complete hint)))

View File

@ -1289,12 +1289,12 @@ than (swconf:config-purge-history-days-offset) days in the past"
(order-by (:desc :updated-at))))) (order-by (:desc :updated-at)))))
(defun all-chat-messages (chat-id) (defun all-chat-messages (chat-id)
"Return all messages belonging to `chat-id' ordered by `message-id' "Return all messages belonging to `chat-id' ordered by `id'
in ascending order" in ascending order"
(query (select :* (query (select :*
(from +table-chat-message+) (from +table-chat-message+)
(where (:= :chat-id chat-id)) (where (:= :chat-id chat-id))
(order-by (:asc :message-id))))) (order-by (:asc :id)))))
(defun last-chat-message-id (chat-id) (defun last-chat-message-id (chat-id)
(second (fetch-single (select ((:as (fields (:max :id)) :max-id)) (second (fetch-single (select ((:as (fields (:max :id)) :max-id))

View File

@ -17,12 +17,17 @@
(in-package :main) (in-package :main)
(defparameter *tick* 0.0) (defparameter *time* 0.0)
(defparameter *ticks* 0)
(define-constant +dt+ (/ 1 +fps+) :test #'=) (define-constant +dt+ (/ 1 +fps+) :test #'=)
(defun incf-dt () (defun incf-dt ()
(incf *tick* +dt+)) (incf *time* +dt+))
(defun incf-ticks ()
(incf *ticks*))
(defun setup-bindings () (defun setup-bindings ()
"This is where an UI event is bound to a function the event nil is "This is where an UI event is bound to a function the event nil is
@ -50,6 +55,8 @@ etc.) happened"
(lambda (w e) (lambda (w e)
(declare (ignore w e)) (declare (ignore w e))
(incf-dt) (incf-dt)
(incf-ticks)
;(scheduled-events:run-scheduled-events *ticks*)
(program-events:dispatch-program-events) (program-events:dispatch-program-events)
(windows:calculate-all +dt+))))) (windows:calculate-all +dt+)))))
@ -144,7 +151,6 @@ etc.) happened"
(unwind-protect (unwind-protect
(progn (progn
(hooks:run-hooks 'hooks:*before-main-loop*) (hooks:run-hooks 'hooks:*before-main-loop*)
(ui:update-all-chats-data)
(run-event-loop croatoan-window)) (run-event-loop croatoan-window))
(end-screen))))) (end-screen)))))

View File

@ -91,7 +91,7 @@
(let* ((height (1- (win-height-no-border window))) (let* ((height (1- (win-height-no-border window)))
(rows-count (- (length rows) height)) (rows-count (- (length rows) height))
(fraction (/ row-selected-index (fraction (/ row-selected-index
(max 1 (1- rows-count)))) (max 1 rows-count)))
(mark-y (1+ (truncate (* fraction height)))) (mark-y (1+ (truncate (* fraction height))))
(mark-x (1- (win-width window)))) (mark-x (1- (win-width window))))
(print-text window line-position-mark mark-x mark-y)))) (print-text window line-position-mark mark-x mark-y))))

View File

@ -1146,7 +1146,8 @@
:followed-user-complete :followed-user-complete
:tags-complete :tags-complete
:conversation-folder :conversation-folder
:make-complete-gemini-uri-fn)) :make-complete-gemini-uri-fn
:complete-chat-message))
(defpackage :program-events (defpackage :program-events
(:use (:use
@ -1242,6 +1243,7 @@
:get-chats-event :get-chats-event
:chat-show-event :chat-show-event
:update-all-chat-messages-event :update-all-chat-messages-event
:chat-post-message-event
:function-event :function-event
:dispatch-program-events :dispatch-program-events
:add-pagination-status-event :add-pagination-status-event
@ -1278,7 +1280,8 @@
:fetch-chat-messages :fetch-chat-messages
:delete-chat-message :delete-chat-message
:get-chat-messages :get-chat-messages
:get-chats)) :get-chats
:post-on-chat))
(defpackage :api-client (defpackage :api-client
(:use (:use
@ -2176,8 +2179,10 @@
:refresh-chat-messages :refresh-chat-messages
:close-chats-list-window :close-chats-list-window
:update-all-chats-data :update-all-chats-data
:update-all-chats-messages
:open-chats-list-window :open-chats-list-window
:show-chat-to-screen :show-chat-to-screen
:chat-loop
:open-gemini-address :open-gemini-address
:gemini-history-back :gemini-history-back
:gemini-view-source :gemini-view-source
@ -2188,6 +2193,23 @@
:gemini-streams-window-close :gemini-streams-window-close
:gemini-streams-window-open-stream)) :gemini-streams-window-open-stream))
(defpackage :scheduled-events
(:use
:cl
:alexandria
:cl-ppcre
:croatoan
:config
:constants
:misc-utils
:text-utils
:specials)
(:shadowing-import-from :misc :random-elt :shuffle)
(:export
:refresh-refresh-all-chats-data
:refresh-refresh-all-chats-messages
:run-scheduled-events))
(defpackage :modules (defpackage :modules
(:use (:use
:cl :cl

View File

@ -1034,6 +1034,21 @@
(chats-list-window:chat->text chat)) (chats-list-window:chat->text chat))
(windows:draw specials:*message-window*)))) (windows:draw specials:*message-window*))))
(defclass chat-post-message-event (program-event)
((message
:initform nil
:initarg :message
:accessor message)
(chat-id
:initform nil
:initarg :chat-id
:accessor chat-id)))
(defmethod process-event ((object chat-post-message-event))
(with-accessors ((message message)
(chat-id chat-id)) object
(api-pleroma:post-on-chat chat-id message)))
;;;; general usage ;;;; general usage
(defclass function-event (program-event) ()) (defclass function-event (program-event) ())

44
src/scheduled-events.lisp Normal file
View File

@ -0,0 +1,44 @@
;; tinmop: an humble gemini and pleroma client
;; Copyright (C) 2020 cage
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program.
;; If not, see [[http://www.gnu.org/licenses/][http://www.gnu.org/licenses/]].
(in-package :scheduled-events)
(define-constant +refresh-all-chats-data-frequency+ 10000 :test #'=)
(define-constant +refresh-all-chats-messages-frequency+ 1000 :test #'=)
(defun triggedp (ticks frequency)
(= (rem ticks frequency)
0))
(defmacro gen-scheduler-function ((name frequency) &body body-if-triggered)
`(defun ,(format-fn-symbol t "~a" name) (ticks)
(when (triggedp ticks ,frequency)
,@body-if-triggered)))
(gen-scheduler-function (refresh-refresh-all-chats-data
+refresh-all-chats-data-frequency+)
(ui:notify (_ "Updating all chats."))
(ui:update-all-chats-data))
(gen-scheduler-function (refresh-refresh-all-chats-messages
+refresh-all-chats-messages-frequency+)
(ui:update-all-chats-messages))
(defun run-scheduled-events (ticks)
(refresh-refresh-all-chats-messages ticks)
(refresh-refresh-all-chats-data ticks))

View File

@ -1425,9 +1425,12 @@ mot recent updated to least recent"
(defun close-chats-list-window () (defun close-chats-list-window ()
(close-window-and-return-to-threads specials:*chats-list-window*)) (close-window-and-return-to-threads specials:*chats-list-window*))
(defun update-all-chats-messages ()
(program-events:push-event (make-instance 'program-events:update-all-chat-messages-event)))
(defun update-all-chats-data () (defun update-all-chats-data ()
(refresh-chats) (refresh-chats)
(program-events:push-event (make-instance 'program-events:update-all-chat-messages-event))) (update-all-chats-messages))
(defun show-chat-to-screen () (defun show-chat-to-screen ()
(when-let* ((fields (line-oriented-window:selected-row-fields *chats-list-window*)) (when-let* ((fields (line-oriented-window:selected-row-fields *chats-list-window*))
@ -1435,12 +1438,42 @@ mot recent updated to least recent"
(chat (db:find-chat chat-id)) (chat (db:find-chat chat-id))
(event (make-instance 'program-events:chat-show-event (event (make-instance 'program-events:chat-show-event
:chat chat))) :chat chat)))
(program-events:push-event event))) (close-chats-list-window)
(program-events:push-event event)
(chat-loop chat)))
(defun chat-loop (chat)
(labels ((post-message (message)
(let ((event (make-instance 'program-events:chat-post-message-event
:priority +maximum-event-priority+
:message message
:chat-id (db:row-id chat))))
(push-event event)))
(%loop ()
(labels ((on-message-composed (message)
(when (string-not-empty-p message)
(post-message message)
(update-all-chats-messages)
(let ((show-event (make-instance 'program-events:chat-show-event
:priority +minimum-event-priority+
:chat chat)))
(push-event show-event)
(%loop))))
(ask-fn ()
(lambda ()
(ask-string-input #'on-message-composed
:priority +minimum-event-priority+
:prompt (_ "Add message (enter to quit): ")
:complete-fn #'complete:complete-chat-message))))
(push-event (make-instance 'function-event
:priority +minimum-event-priority+
:payload (ask-fn))))))
(%loop)))
;;;; gemini ;;;; gemini
(defun open-gemini-address () (defun open-gemini-address ()
"Ask for a gemini addresss and try to load it" "Ask for a gemini address and try to load it"
(flet ((on-input-complete (url) (flet ((on-input-complete (url)
(if (gemini-parser:gemini-uri-p url) (if (gemini-parser:gemini-uri-p url)
(let* ((event (make-instance 'gemini-request-event (let* ((event (make-instance 'gemini-request-event

View File

@ -117,6 +117,7 @@
(:file "gemini-viewer") (:file "gemini-viewer")
(:file "main-window") (:file "main-window")
(:file "ui-goodies") (:file "ui-goodies")
(:file "scheduled-events")
(:file "modules") (:file "modules")
(:file "main") (:file "main")
(:module tests (:module tests