1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 19:53:13 +02:00

api: add info "uptime_current"

This info returns time duration between the start of the current WeeChat
process and now (so upgrades with /upgrade are ignored).
This commit is contained in:
Sébastien Helleu
2022-07-10 13:02:35 +02:00
parent c4cade3550
commit e057c16b36
23 changed files with 173 additions and 56 deletions
+7
View File
@@ -15,6 +15,13 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
(file _ReleaseNotes.adoc_ in sources).
[[v3.7]]
== Version 3.7 (under dev)
New features::
* api: add info "uptime_current"
[[v3.6]]
== Version 3.6 (2022-07-10)
@@ -128,6 +128,8 @@
| weechat | uptime | Laufzeit von WeeChat (Format: "days:hh:mm:ss") | "days" (Anzahl der Tage) oder "seconds" (Anzahl der Sekunden) (optional)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | "days" (Anzahl der Tage) oder "seconds" (Anzahl der Sekunden) (optional)
| weechat | version | WeeChat-Version | -
| weechat | version_git | WeeChat Git Version (Ausgabe des Befehls "git describe", ausschließlich für eine Entwicklerversion. Eine stabile Version gibt keine Information zurück) | -
@@ -128,6 +128,8 @@
| weechat | uptime | WeeChat uptime (format: "days:hh:mm:ss") | "days" (number of days) or "seconds" (number of seconds) (optional)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | "days" (number of days) or "seconds" (number of seconds) (optional)
| weechat | version | WeeChat version | -
| weechat | version_git | WeeChat git version (output of command "git describe" for a development version only, empty for a stable release) | -
@@ -128,6 +128,8 @@
| weechat | uptime | Durée de fonctionnement de WeeChat (format : "jours:hh:mm:ss") | "days" (nombre de jours) ou "seconds" (nombre de secondes) (optionnel)
| weechat | uptime_current | Durée de fonctionnement de WeeChat pour le processus actuel seulement (les mises à jour par la commande /upgrade sont ignorées) (format : "jours:hh:mm:ss") | "days" (nombre de jours) ou "seconds" (nombre de secondes) (optionnel)
| weechat | version | version de WeeChat | -
| weechat | version_git | version git de WeeChat (sortie de la commande "git describe" pour une version de développement seulement, vide pour une version stable) | -
@@ -128,6 +128,8 @@
| weechat | uptime | WeeChat uptime (format: "days:hh:mm:ss") | "days" (number of days) or "seconds" (number of seconds) (optional)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | "days" (number of days) or "seconds" (number of seconds) (optional)
| weechat | version | versione di WeeChat | -
| weechat | version_git | Versione git di weechat (output del comando "git describe" solo per la versione di sviluppo, vuoto per una release stabile) | -
@@ -128,6 +128,8 @@
| weechat | uptime | WeeChat 連続稼働時間 (書式: "days:hh:mm:ss") | "days" (日数) または "seconds" (秒数) (任意)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | "days" (日数) または "seconds" (秒数) (任意)
| weechat | version | WeeChat のバージョン | -
| weechat | version_git | WeeChat の git バージョン (開発バージョンではコマンド "git describe" の出力、安定版リリースでは空文字が出力されます) | -
@@ -128,6 +128,8 @@
| weechat | uptime | Uptime WeeChat (format: "dni:hh:mm:ss") | "dni" (ilość dni) lub "sekundy" (ilość sekund) (opcjonalne)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | "dni" (ilość dni) lub "sekundy" (ilość sekund) (opcjonalne)
| weechat | version | Wersja WeeChat | -
| weechat | version_git | Wersja git WeeChat (wyjście komendy "git describe" dla tylko dla wersji rozwojowej, puste dla wersji stabilnej) | -
@@ -128,6 +128,8 @@
| weechat | uptime | WeeChat време извршавања (формат: „дана:чч:мм:сс”) | „days” (број дана) или „seconds” (број секунди) (није обавезно)
| weechat | uptime_current | WeeChat uptime for the current process only (upgrades with /upgrade command are ignored) (format: "days:hh:mm:ss") | „days” (број дана) или „seconds” (број секунди) (није обавезно)
| weechat | version | верзија програма WeeChat | -
| weechat | version_git | WeeChat git верзија (излаз команде „git describe” само за развојну верзију, празно за стабилну верзију) | -
+8 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:11+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10659,6 +10659,13 @@ msgstr "WeeChat uptime (formát: \"dny:hh:mm:ss\")"
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "WeeChat uptime (formát: \"dny:hh:mm:ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+10 -30
View File
@@ -25,7 +25,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-20 13:39+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -8684,9 +8684,6 @@ msgstr ""
msgid "configure the \"autojoin\" server option"
msgstr "Konfigurieren der Serveroption \"autojoin\""
#| msgid ""
#| "add [<channel1> [<channel2>...]] || addraw <channel1>[,<channel2>...] "
#| "[<key1>[,<key2>...]] || del [<channel1> [<channel2>...]] || save || sort"
msgid ""
"add [<channel1> [<channel2>...]] || addraw <channel1>[,<channel2>...] "
"[<key1>[,<key2>...]] || del [<channel1> [<channel2>...]] || apply || sort"
@@ -8694,28 +8691,6 @@ msgstr ""
"add [<channel1> [<channel2>...]] || addraw <channel1>[,<channel2>...] "
"[<key1>[,<key2>...]] || del [<channel1> [<channel2>...]] || apply || sort"
#| msgid ""
#| " add: add current channel or a list of channels (with optional keys) "
#| "to the autojoin option; if you are on the channel and the key is not "
#| "provided, the key is read in the channel\n"
#| " addraw: use the IRC raw format (same as /join command): all channels "
#| "separated by commas, optional keys separated by commas\n"
#| " del: delete current channel or a list of channels from the autojoin "
#| "option\n"
#| "channel: channel name\n"
#| " key: key for the channel\n"
#| " save: save currently joined channels in the autojoin option\n"
#| " sort: sort alphabetically channels in the autojoin option\n"
#| "\n"
#| "Examples:\n"
#| " /autojoin add\n"
#| " /autojoin add #test\n"
#| " /autojoin add #chan1 #chan2\n"
#| " /autojoin addraw #chan1,#chan2,#chan3 key1,key2\n"
#| " /autojoin del\n"
#| " /autojoin del #chan1\n"
#| " /autojoin save\n"
#| " /autojoin sort"
msgid ""
" add: add current channel or a list of channels (with optional keys) to "
"the autojoin option; if you are on the channel and the key is not provided, "
@@ -12966,6 +12941,13 @@ msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
"\"days\" (Anzahl der Tage) oder \"seconds\" (Anzahl der Sekunden) (optional)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "Laufzeit von WeeChat (Format: \"days:hh:mm:ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "generiert ein Time-based One-Time Passwort (TOTP)"
@@ -15347,8 +15329,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat"
msgid ""
"list|listfull|listdefault || add|addoff|addreplace <name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|-"
"all [<name>...]] || restart <name>|-all [<name>...] || show <name> || del "
@@ -15356,8 +15337,7 @@ msgid ""
"monitor [<filter>]"
msgstr ""
"list|listfull|listdefault || add|addoff|addreplace <name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|-"
"all [<name>...]] || restart <name>|-all [<name>...] || show <name> || del "
+6 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:11+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -11328,6 +11328,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+10 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-07-10 12:32+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -12668,6 +12668,14 @@ msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
"\"days\" (nombre de jours) ou \"seconds\" (nombre de secondes) (optionnel)"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
"Durée de fonctionnement de WeeChat pour le processus actuel seulement (les "
"mises à jour par la commande /upgrade sont ignorées) (format : \"jours:hh:mm:"
"ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "générer un mot de passe à usage unique basé sur le temps (TOTP)"
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10138,6 +10138,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+6 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -11122,6 +11122,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+8 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -12103,6 +12103,13 @@ msgstr "WeeChat 連続稼働時間 (書式: \"days:hh:mm:ss\")"
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr "\"days\" (日数) または \"seconds\" (秒数) (任意)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "WeeChat 連続稼働時間 (書式: \"days:hh:mm:ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "時間ベースのワンタイムパスワード (TOTP) を生成"
+8 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -12514,6 +12514,13 @@ msgstr "Uptime WeeChat (format: \"dni:hh:mm:ss\")"
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr "\"dni\" (ilość dni) lub \"sekundy\" (ilość sekund) (opcjonalne)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "Uptime WeeChat (format: \"dni:hh:mm:ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "generuje Time-based One-Time Password (TOTP)"
+8 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:12+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -11920,6 +11920,13 @@ msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
"\"dias\" (número de dias) ou \"segundos\" (número de segundos) (opcional)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "WeeChat uptime (formato: \"dias:hh:mm:ss\")"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10619,6 +10619,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-04-24 10:20+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -10176,6 +10176,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+8 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-07-06 08:29+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -12368,6 +12368,13 @@ msgstr "WeeChat време извршавања (формат: „дана:чч:
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr "„days” (број дана) или „seconds” (број секунди) (није обавезно)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "WeeChat време извршавања (формат: „дана:чч:мм:сс”)"
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "генерисање Time-based One-Time Password (TOTP)"
+8 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2022-06-18 16:13+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -12367,6 +12367,13 @@ msgstr "WeeChat çalışma süresi (biçim: \"gün:sa:dk:sn\""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr "\"gün\" (gün sayısı) veya \"saniye\" (saniye sayısı) (isteğe bağlı)"
#, fuzzy
#| msgid "WeeChat uptime (format: \"days:hh:mm:ss\")"
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr "WeeChat çalışma süresi (biçim: \"gün:sa:dk:sn\""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr "zaman tabanlı bir kerelik parola oluştur (TOTP)"
+6 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2022-06-18 16:05+0200\n"
"POT-Creation-Date: 2022-07-10 12:31+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9141,6 +9141,11 @@ msgstr ""
msgid "\"days\" (number of days) or \"seconds\" (number of seconds) (optional)"
msgstr ""
msgid ""
"WeeChat uptime for the current process only (upgrades with /upgrade command "
"are ignored) (format: \"days:hh:mm:ss\")"
msgstr ""
msgid "generate a Time-based One-Time Password (TOTP)"
msgstr ""
+48 -12
View File
@@ -800,27 +800,20 @@ plugin_api_info_nick_color_name_cb (const void *pointer, void *data,
}
/*
* Returns WeeChat info "uptime".
* Returns uptime according to the start date and arguments.
*/
char *
plugin_api_info_uptime_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
plugin_api_info_build_uptime (time_t start_time, const char *arguments)
{
char value[128];
time_t total_seconds;
int days, hours, minutes, seconds;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
if (!arguments || !arguments[0])
{
/* return uptime with format: "days:hh:mm:ss" */
util_get_time_diff (weechat_first_start_time, time (NULL),
util_get_time_diff (start_time, time (NULL),
NULL, &days, &hours, &minutes, &seconds);
snprintf (value, sizeof (value), "%d:%02d:%02d:%02d",
days, hours, minutes, seconds);
@@ -830,7 +823,7 @@ plugin_api_info_uptime_cb (const void *pointer, void *data,
if (strcmp (arguments, "days") == 0)
{
/* return the number of days */
util_get_time_diff (weechat_first_start_time, time (NULL),
util_get_time_diff (start_time, time (NULL),
NULL, &days, NULL, NULL, NULL);
snprintf (value, sizeof (value), "%d", days);
return strdup (value);
@@ -839,7 +832,7 @@ plugin_api_info_uptime_cb (const void *pointer, void *data,
if (strcmp (arguments, "seconds") == 0)
{
/* return the number of seconds */
util_get_time_diff (weechat_first_start_time, time (NULL),
util_get_time_diff (start_time, time (NULL),
&total_seconds, NULL, NULL, NULL, NULL);
snprintf (value, sizeof (value), "%lld", (long long)total_seconds);
return strdup (value);
@@ -848,6 +841,43 @@ plugin_api_info_uptime_cb (const void *pointer, void *data,
return NULL;
}
/*
* Returns WeeChat info "uptime".
*/
char *
plugin_api_info_uptime_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
return plugin_api_info_build_uptime (weechat_first_start_time, arguments);
}
/*
* Returns WeeChat info "uptime_current" (current run: from last start,
* upgrades are ignored).
*/
char *
plugin_api_info_uptime_current_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
return plugin_api_info_build_uptime (
(time_t)weechat_current_start_timeval.tv_sec,
arguments);
}
/*
* Returns WeeChat info "totp_generate": generates a Time-based One-Time
* Password (TOTP).
@@ -1976,6 +2006,12 @@ plugin_api_info_init ()
N_("\"days\" (number of days) or \"seconds\" (number of "
"seconds) (optional)"),
&plugin_api_info_uptime_cb, NULL, NULL);
hook_info (NULL, "uptime_current",
N_("WeeChat uptime for the current process only (upgrades with "
"/upgrade command are ignored) (format: \"days:hh:mm:ss\")"),
N_("\"days\" (number of days) or \"seconds\" (number of "
"seconds) (optional)"),
&plugin_api_info_uptime_current_cb, NULL, NULL);
hook_info (NULL, "totp_generate",
N_("generate a Time-based One-Time Password (TOTP)"),
N_("secret (in base32), timestamp (optional, current time by "