1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

doc: add examples of command responses in relay protocol

This commit is contained in:
Sébastien Helleu
2020-05-02 12:28:14 +02:00
parent 5b4d690ed7
commit 46a2979aa1
3 changed files with 1911 additions and 260 deletions
+626 -77
View File
@@ -169,21 +169,59 @@ WeeChat replies with a hashtable containing the following keys and values:
and the user password (the _relay_ nonce + the client nonce is the salt used
in the password hash algorithm)
[TIP]
With WeeChat ≤ 2.8, the command _handshake_ is not implemented, WeeChat silently
ignores this command, even if it is sent before the _init_ command. +
So it is safe to send this command to any WeeChat version.
Examples:
* Nothing offered by the client, authentication password "plain" will be used
if allowed on relay side:
----
# nothing offered by the client (or only "plain"), authentication password "plain" will be used if allowed on relay side
handshake
handshake password_hash_algo=plain
# only plain, sha256 and pbkdf2+sha256 are supported by the client
handshake password_hash_algo=plain:sha256:pbkdf2+sha256
# only sha256 and sha512 are supported by the client, disable compression
handshake password_hash_algo=sha256:sha512,compression=off
(handshake) handshake
----
Example of response:
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Only "plain" is supported by the client:
----
(handshake) handshake password_hash_algo=plain
----
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Only "plain", "sha256" and "pbkdf2+sha256" are supported by the client:
----
(handshake) handshake password_hash_algo=plain:sha256:pbkdf2+sha256
----
Response:
[source,python]
----
@@ -204,10 +242,24 @@ the password is "test" in this example:
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
[TIP]
With WeeChat ≤ 2.8, the command _handshake_ is not implemented, WeeChat silently
ignores this command, even if it is sent before the _init_ command. +
So it is safe to send this command to any WeeChat version.
* Only "sha256" and "sha512" are supported by the client, disable compression:
----
(handshake) handshake password_hash_algo=sha256:sha512,compression=off
----
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'sha512',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
[[command_init]]
=== init
@@ -277,26 +329,42 @@ Hexadecimal strings can be lower or upper case, _relay_ can decode both.
Examples:
* Initialize with password:
----
# initialize and use zlib compression by default (if WeeChat supports it)
init password=mypass
----
# initialize with commas in the password (WeeChat ≥ 1.6)
* Initialize with commas in the password _(WeeChat ≥ 1.6)_:
----
init password=mypass\,with\,commas
----
# initialize with password and TOTP (WeeChat ≥ 2.4)
* Initialize with password and TOTP _(WeeChat ≥ 2.4)_:
----
init password=mypass,totp=123456
----
# initialize and disable compression
init password=mypass,compression=off
* Initialize with hashed password "test" (SHA256: salt=relay nonce + client nonce)
_(WeeChat ≥ 2.9)_:
# initialize with hashed password "test" (SHA256: salt=relay nonce + client nonce) (WeeChat ≥ 2.9)
----
init password_hash=sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:2c6ed12eb0109fca3aedc03bf03d9b6e804cd60a23e1731fd17794da423e21db
----
# initialize with hashed password "test" (SHA512: salt=relay nonce + client nonce) (WeeChat ≥ 2.9)
* Initialize with hashed password "test" (SHA512: salt=relay nonce + client nonce)
_(WeeChat ≥ 2.9)_:
----
init password_hash=sha512:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:0a1f0172a542916bd86e0cbceebc1c38ed791f6be246120452825f0d74ef1078c79e9812de8b0ab3dfaf598b6ca14522374ec6a8653a46df3f96a6b54ac1f0f8
----
# initialize with hashed password "test" (PBKDF2: SHA256, salt=relay nonce + client nonce, 100000 iterations) (WeeChat ≥ 2.9)
* Initialize with hashed password "test" (PBKDF2: SHA256, salt=relay nonce + client nonce,
100000 iterations) _(WeeChat ≥ 2.9)_:
----
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
@@ -337,20 +405,131 @@ With older versions, nothing was returned.
Examples:
* Request "number" and "full_name" of all buffers:
----
(hdata_buffers) hdata buffer:gui_buffers(*) number,full_name
----
# request all buffers, hdata of type "buffer" is returned
# keys "number" and "name" are returned for each buffer
hdata buffer:gui_buffers(*) number,name
# request all lines of all buffers, hdata of type "line_data" is returned
# all keys are returned
hdata buffer:gui_buffers(*)/lines/first_line(*)/data
Response:
# request full name of first buffer
hdata buffer:gui_buffers full_name
[source,python]
----
id: 'hdata_buffers'
hda:
keys: {
'number': 'int',
'full_name': 'str',
}
path: ['buffer']
item 1:
__path: ['0x558d61ea3e60']
number: 1
full_name: 'core.weechat'
item 2:
__path: ['0x558d62840ea0']
number: 1
full_name: 'irc.server.freenode'
item 3:
__path: ['0x558d62a9cea0']
number: 2
full_name: 'irc.freenode.#weechat'
----
# request the hotlist content
hdata hotlist:gui_hotlist(*)
* Request all lines of first buffer:
----
(hdata_lines) hdata buffer:gui_buffers/own_lines/first_line(*)/data
----
Response:
[source,python]
----
id: 'hdata_lines'
hda:
keys: {
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_printed': 'tim',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
'refresh_needed': 'chr',
'prefix': 'str',
'prefix_length': 'int',
'message': 'str',
}
path: ['buffer', 'lines', 'line', 'line_data']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d62920d80', '0x558d62abf040']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_printed: 1588404926
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the first line'
item 2:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d626779f0', '0x558d62af9700']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_printed: 1588404930
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the second line'
----
* Request the hotlist content:
----
(hdata_hotlist) hdata hotlist:gui_hotlist(*)
----
Response:
[source,python]
----
id: 'hdata_hotlist'
hda:
keys: {
'priority': 'int',
'creation_time.tv_sec': 'tim',
'creation_time.tv_usec': 'lon',
'buffer': 'ptr',
'count': 'arr',
'prev_hotlist': 'ptr',
'next_hotlist': 'ptr',
}
path: ['hotlist']
item 1:
__path: ['0x558d629601b0']
priority: 3
creation_time.tv_sec: 1588405398
creation_time.tv_usec: 355383
buffer: '0x558d62a9cea0'
count: [1, 1, 0, 1]
prev_hotlist: '0x0'
next_hotlist: '0x0'
----
[[command_info]]
@@ -368,10 +547,48 @@ Arguments:
* _name_: name of info to retrieve
Example:
Examples:
* Request WeeChat version:
----
info version
(info_version) info version
----
Response:
[source,python]
----
id: 'info_version'
inf: ('version', '2.9-dev')
----
* Request WeeChat version as number:
----
(info_version_number) info version_number
----
Response:
[source,python]
----
id: 'info_version_number'
inf: ('version_number', '34144256')
----
* Request WeeChat directory:
----
(info_weechat_dir) info weechat_dir
----
Response:
[source,python]
----
id: 'info_weechat_dir'
inf: ('weechat_dir', '/home/xxx/.weechat')
----
[[command_infolist]]
@@ -396,10 +613,115 @@ Arguments:
* _pointer_: pointer (optional)
* _arguments_: arguments (optional)
Example:
Examples:
* Request infolist "buffer":
----
infolist buffer
(infolist_buffer) infolist buffer
----
Response:
[source,python]
----
id: 'infolist_buffer'
inl:
name: buffer
item 1:
pointer: '0x558d61ea3e60'
current_buffer: 1
plugin: '0x0'
plugin_name: 'core'
number: 1
layout_number: 1
layout_number_merge_order: 0
name: 'weechat'
full_name: 'core.weechat'
old_full_name: None
short_name: 'weechat'
type: 0
notify: 3
num_displayed: 1
active: 1
hidden: 0
zoomed: 0
print_hooks_enabled: 1
day_change: 1
clear: 1
filter: 1
closing: 0
first_line_not_read: 0
lines_hidden: 0
prefix_max_length: 0
time_for_each_line: 1
nicklist_case_sensitive: 0
nicklist_display_groups: 1
nicklist_max_length: 0
nicklist_count: 0
nicklist_groups_count: 0
nicklist_nicks_count: 0
nicklist_visible_count: 0
title: 'WeeChat 2.9-dev (C) 2003-2020 - https://weechat.org/'
input: 1
input_get_unknown_commands: 0
input_get_empty: 0
input_buffer: ''
input_buffer_alloc: 256
input_buffer_size: 0
input_buffer_length: 0
input_buffer_pos: 0
input_buffer_1st_display: 0
num_history: 0
text_search: 0
text_search_exact: 0
text_search_regex: 0
text_search_regex_compiled: '0x0'
text_search_where: 0
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
highlight_tags: None
hotlist_max_level_nicks: None
keys_count: 0
localvar_name_00000: 'plugin'
localvar_value_00000: 'core'
localvar_name_00001: 'name'
localvar_value_00001: 'weechat'
----
* Request infolist "window":
----
(infolist_window) infolist window
----
Response:
[source,python]
----
id: 'infolist_window'
inl:
name: window
item 1:
pointer: '0x558d61ddc800'
current_window: 1
number: 1
x: 14
y: 0
width: 259
height: 71
width_pct: 100
height_pct: 100
chat_x: 14
chat_y: 1
chat_width: 259
chat_height: 68
buffer: '0x558d61ea3e60'
start_line_y: 0
----
[[command_nicklist]]
@@ -420,12 +742,187 @@ Arguments:
Examples:
----
# request nicklist for all buffers
nicklist
* Request nicklist for all buffers:
# request nicklist for irc.freenode.#weechat
nicklist irc.freenode.#weechat
----
(nicklist_all) nicklist
----
Response:
[source,python]
----
id: 'nicklist_all'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea4120']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62840ea0', '0x558d61e75f90']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 4:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 6:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 7:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 8:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
item 9:
__path: ['0x558d62914680', '0x558d62afc4b0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
----
* Request nicklist for buffer "irc.freenode.#weechat":
----
(nicklist_weechat) nicklist irc.freenode.#weechat
----
Response:
[source,python]
----
id: 'nicklist_weechat'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 4:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 6:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
----
[[command_input]]
@@ -448,8 +945,15 @@ Arguments:
Examples:
* Send command "/help filter" on WeeChat core bufer:
----
input core.weechat /help filter
----
* Send message "hello!" to #weechat channel:
----
input irc.freenode.#weechat hello!
----
@@ -494,17 +998,19 @@ WeeChat replies with a hdata:
In case of error, for example invalid buffer or internal error on WeeChat side,
an empty hdata is returned.
Example: completion of a command argument:
Examples:
* Completion of a command argument:
----
(test) completion core.weechat -1 /help fi
(completion_help) completion core.weechat -1 /help fi
----
Response:
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {
'context': 'str',
@@ -530,17 +1036,17 @@ hda:
]
----
Example: completion of a command in the middle of a word:
* Completion of a command in the middle of a word:
----
(test) completion core.weechat 5 /quernick
(completion_query) completion core.weechat 5 /quernick
----
Response:
[source,python]
----
id: 'test'
id: 'completion_query'
hda:
keys: {
'context': 'str',
@@ -561,17 +1067,17 @@ hda:
list: ['query']
----
Example: nothing to complete:
* Nothing to complete:
----
(test) completion core.weechat -1 abcdefghijkl
(completion_abcdefghijkl) completion core.weechat -1 abcdefghijkl
----
Response:
[source,python]
----
id: 'test'
id: 'completion_abcdefghijkl'
hda:
keys: {
'context': 'str',
@@ -592,17 +1098,17 @@ hda:
list: []
----
Example: invalid buffer:
* Completion on an invalid buffer:
----
(test) completion buffer.does.not.exist -1 /help fi
(completion_help) completion buffer.does.not.exist -1 /help fi
----
Response:
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {}
path: ['completion']
@@ -646,21 +1152,30 @@ Arguments:
Examples:
* Synchronize all buffers with nicklist (the 3 commands are equivalent,
but the first one is recommended for compatibility with future versions):
----
# synchronize all buffers with nicklist
# (the 3 commands are equivalent, but the first one is recommended
# for compatibility with future versions)
sync
sync *
sync * buffers,upgrade,buffer,nicklist
----
# synchronize core buffer
* Synchronize WeeChat core buffer:
----
sync core.buffer
----
# synchronize #weechat channel, without nicklist
* Synchronize #weechat channel, without nicklist:
----
sync irc.freenode.#weechat buffer
----
# get general signals + all signals for #weechat channel
* Get general signals + all signals for #weechat channel:
----
sync * buffers,upgrade
sync irc.freenode.#weechat
----
@@ -699,18 +1214,24 @@ it explicitly to stop updates).
Examples:
* Desynchronize all buffers (the 3 commands are equivalent, but the first one
is recommended for compatibility with future versions):
----
# desynchronize all buffers
# (the 3 commands are equivalent, but the first one is recommended
# for compatibility with future versions)
desync
desync *
desync * buffers,upgrade,buffer,nicklist
----
# desynchronize nicklist for #weechat channel (keep buffer updates)
* Desynchronize nicklist for #weechat channel (keep buffer updates):
----
desync irc.freenode.#weechat nicklist
----
# desynchronize #weechat channel
* Desynchronize #weechat channel:
----
desync irc.freenode.#weechat
----
@@ -722,21 +1243,10 @@ Test command: WeeChat will reply with various different objects.
This command is useful to test the decoding of binary objects returned by
WeeChat.
[IMPORTANT]
You must not use the pointer values returned by this command, they are not
valid. This command must be used only to test decoding of a message sent by
WeeChat.
Syntax:
----
test
----
Example:
----
test
(id) test
----
Returned objects (in this order):
@@ -761,6 +1271,38 @@ Returned objects (in this order):
| array of integers | arr int | [ 123, 456, 789 ]
|===
[IMPORTANT]
You must not use the pointer values returned by this command, they are not
valid. This command must be used only to test decoding of a message sent by
WeeChat.
Example:
----
(test) test
----
Response:
----
id: 'test'
chr: 65
int: 123456
int: -123456
lon: 1234567890
lon: -1234567890
str: 'a string'
str: ''
str: None
buf: 'buffer'
buf: None
ptr: '0x1234abcd'
ptr: '0x0'
tim: 1321993456
arr: ['abc', 'de']
arr: [123, 456, 789]
----
[[command_ping]]
=== ping
@@ -783,6 +1325,13 @@ Example:
ping 1370802127000
----
Response:
----
id:'_pong'
str: '1370802127000'
----
[[command_quit]]
=== quit
@@ -1200,7 +1749,7 @@ hda:
'type': 'private',
'channel': 'FlashCode',
'nick': 'test',
'name': 'local.Flash2',
'name': 'freenode.Flash2',
}
----
+630 -83
View File
@@ -9,14 +9,13 @@
:docinfo1:
[[introduction]]
== Introduction
Ce document est une spécification du protocole Relay de WeeChat : le protocole
utilisé pour relayer les données de WeeChat aux clients, qui sont surtout des
interfaces distantes.
[[introduction]]
== Introduction
[[terminology]]
=== Terminologie
@@ -179,21 +178,58 @@ suivantes :
_relay_ + le nonce client constituent le sel utilisé dans l'algorithme de
hachage du mot de passe)
[TIP]
Avec WeeChat ≤ 2.8, la commande _handshake_ n'est pas implémentée, WeeChat ignore
silencieusement cette commande, même si elle est envoyée avant la commande _init_. +
Il est donc sûr d'envoyer cette commande à n'importe quelle version de WeeChat.
Exemples :
* Rien d'offert par le client, l'authentification par mot de passe "plain" sera utilisée si autorisée côté relay :
----
# rien d'offert par le client (ou seulement "plain"), l'authentification par mot de passe "plain" sera utilisée si autorisée côté relay
handshake
handshake password_hash_algo=plain
# seulement plain, sha256 et pbkdf2+sha256 sont supportés par le client
handshake password_hash_algo=plain:sha256:pbkdf2+sha256
# seulement sha256 et sha512 sont supportés par le client, désactiver la compression
handshake password_hash_algo=sha256:sha512,compression=off
(handshake) handshake
----
Exemple de réponse :
Réponse :
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Seulement "plain" est supporté par le client :
----
(handshake) handshake password_hash_algo=plain
----
Réponse :
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Seulement "plain", "sha256" et "pbkdf2+sha256" sont supportés par le client :
----
(handshake) handshake password_hash_algo=plain:sha256:pbkdf2+sha256
----
Réponse :
[source,python]
----
@@ -214,10 +250,24 @@ le mot de passe est "test" dans cet exemple :
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
[TIP]
Avec WeeChat ≤ 2.8, la commande _handshake_ n'est pas implémentée, WeeChat ignore
silencieusement cette commande, même si elle est envoyée avant la commande _init_. +
Il est donc sûr d'envoyer cette commande à n'importe quelle version de WeeChat.
* Seulement "sha256" et "sha512" sont supportés par le client, désactiver la compression :
----
(handshake) handshake password_hash_algo=sha256:sha512,compression=off
----
Réponse :
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'sha512',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
[[command_init]]
=== init
@@ -288,26 +338,42 @@ peut décoder les deux.
Exemples :
* Initialiser avec un mot de passe :
----
# initialiser et utiliser la compression zlib par défaut (si WeeChat la supporte)
init password=mypass
----
# initialiser avec des virgules dans le mot de passe (WeeChat ≥ 1.6)
* Initialiser avec des virgules dans le mot de passe _(WeeChat ≥ 1.6)_ :
----
init password=mypass\,avec\,virgules
----
# initialiser avec le mot de passe et TOTP (WeeChat ≥ 2.4)
* Initialiser avec le mot de passe et TOTP _(WeeChat ≥ 2.4)_ :
----
init password=mypass,totp=123456
----
# initialiser et désactiver la compression
init password=mypass,compression=off
* Initialiser avec le mot de passe haché "test" (SHA256 : sel=nonce relay + nonce client)
_(WeeChat ≥ 2.9)_ :
# initialiser avec le mot de passe haché "test" (SHA256 : sel=nonce relay + nonce client) (WeeChat ≥ 2.9)
----
init password_hash=sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:2c6ed12eb0109fca3aedc03bf03d9b6e804cd60a23e1731fd17794da423e21db
----
# initialiser avec le mot de passe haché "test" (SHA512 : sel=nonce relay + nonce client) (WeeChat ≥ 2.9)
* Initialiser avec le mot de passe haché "test" (SHA512 : sel=nonce relay + nonce client)
_(WeeChat ≥ 2.9)_ :
----
init password_hash=sha512:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:0a1f0172a542916bd86e0cbceebc1c38ed791f6be246120452825f0d74ef1078c79e9812de8b0ab3dfaf598b6ca14522374ec6a8653a46df3f96a6b54ac1f0f8
----
# initialiser avec le mot de passe haché "test" (PBKDF2 : SHA256, sel=nonce relay + nonce client, 100000 itérations) (WeeChat ≥ 2.9)
* Initialiser avec le mot de passe haché "test" (PBKDF2 : SHA256,
sel=nonce relay + nonce client, 100000 itérations) _(WeeChat ≥ 2.9)_ :
----
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
@@ -350,21 +416,131 @@ Avec des versions plus anciennes, rien n'était retourné.
Exemples :
* Demander "number" et "full_name" de tous les tampons :
----
(hdata_buffers) hdata buffer:gui_buffers(*) number,full_name
----
# demander tous les tampons, un hdata de type "buffer" est retourné
# les clés "number" et "name" sont retournées pour chaque tampon
hdata buffer:gui_buffers(*) number,name
# demander toutes les lignes de tous les tampons, un hdata de type "line_data"
# est retourné
# toutes les clés sont retournées
hdata buffer:gui_buffers(*)/lines/first_line(*)/data
Réponse :
# demander le nom complet du premier tampon
hdata buffer:gui_buffers full_name
[source,python]
----
id: 'hdata_buffers'
hda:
keys: {
'number': 'int',
'full_name': 'str',
}
path: ['buffer']
item 1:
__path: ['0x558d61ea3e60']
number: 1
full_name: 'core.weechat'
item 2:
__path: ['0x558d62840ea0']
number: 1
full_name: 'irc.server.freenode'
item 3:
__path: ['0x558d62a9cea0']
number: 2
full_name: 'irc.freenode.#weechat'
----
# demander le contenu de la hotlist
hdata hotlist:gui_hotlist(*)
* Demander toutes les lignes du premier tampon :
----
(hdata_lines) hdata buffer:gui_buffers/own_lines/first_line(*)/data
----
Réponse :
[source,python]
----
id: 'hdata_lines'
hda:
keys: {
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_printed': 'tim',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
'refresh_needed': 'chr',
'prefix': 'str',
'prefix_length': 'int',
'message': 'str',
}
path: ['buffer', 'lines', 'line', 'line_data']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d62920d80', '0x558d62abf040']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_printed: 1588404926
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the first line'
item 2:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d626779f0', '0x558d62af9700']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_printed: 1588404930
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the second line'
----
* Demander le contenu de la hotlist :
----
(hdata_hotlist) hdata hotlist:gui_hotlist(*)
----
Réponse :
[source,python]
----
id: 'hdata_hotlist'
hda:
keys: {
'priority': 'int',
'creation_time.tv_sec': 'tim',
'creation_time.tv_usec': 'lon',
'buffer': 'ptr',
'count': 'arr',
'prev_hotlist': 'ptr',
'next_hotlist': 'ptr',
}
path: ['hotlist']
item 1:
__path: ['0x558d629601b0']
priority: 3
creation_time.tv_sec: 1588405398
creation_time.tv_usec: 355383
buffer: '0x558d62a9cea0'
count: [1, 1, 0, 1]
prev_hotlist: '0x0'
next_hotlist: '0x0'
----
[[command_info]]
@@ -383,10 +559,48 @@ Paramètres :
* _nom_ : nom de l'info à obtenir
* _paramètres_ : paramètres pour l'info (facultatif)
Exemple :
Exemples :
* Demander la version de WeeChat :
----
info version
(info_version) info version
----
Réponse :
[source,python]
----
id: 'info_version'
inf: ('version', '2.9-dev')
----
* Demander la version de WeeChat sous forme de nombre :
----
(info_version_number) info version_number
----
Réponse :
[source,python]
----
id: 'info_version_number'
inf: ('version_number', '34144256')
----
* Demander le répertoire de WeeChat :
----
(info_weechat_dir) info weechat_dir
----
Réponse :
[source,python]
----
id: 'info_weechat_dir'
inf: ('weechat_dir', '/home/xxx/.weechat')
----
[[command_infolist]]
@@ -412,10 +626,115 @@ Paramètres :
* _pointeur_ : pointeur (facultatif)
* _paramètres_ : paramètres (facultatif)
Exemple :
Exemples :
* Demander l'infolist "buffer" :
----
infolist buffer
(infolist_buffer) infolist buffer
----
Réponse :
[source,python]
----
id: 'infolist_buffer'
inl:
name: buffer
item 1:
pointer: '0x558d61ea3e60'
current_buffer: 1
plugin: '0x0'
plugin_name: 'core'
number: 1
layout_number: 1
layout_number_merge_order: 0
name: 'weechat'
full_name: 'core.weechat'
old_full_name: None
short_name: 'weechat'
type: 0
notify: 3
num_displayed: 1
active: 1
hidden: 0
zoomed: 0
print_hooks_enabled: 1
day_change: 1
clear: 1
filter: 1
closing: 0
first_line_not_read: 0
lines_hidden: 0
prefix_max_length: 0
time_for_each_line: 1
nicklist_case_sensitive: 0
nicklist_display_groups: 1
nicklist_max_length: 0
nicklist_count: 0
nicklist_groups_count: 0
nicklist_nicks_count: 0
nicklist_visible_count: 0
title: 'WeeChat 2.9-dev (C) 2003-2020 - https://weechat.org/'
input: 1
input_get_unknown_commands: 0
input_get_empty: 0
input_buffer: ''
input_buffer_alloc: 256
input_buffer_size: 0
input_buffer_length: 0
input_buffer_pos: 0
input_buffer_1st_display: 0
num_history: 0
text_search: 0
text_search_exact: 0
text_search_regex: 0
text_search_regex_compiled: '0x0'
text_search_where: 0
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
highlight_tags: None
hotlist_max_level_nicks: None
keys_count: 0
localvar_name_00000: 'plugin'
localvar_value_00000: 'core'
localvar_name_00001: 'name'
localvar_value_00001: 'weechat'
----
* Demander l'infolist "window" :
----
(infolist_window) infolist window
----
Réponse :
[source,python]
----
id: 'infolist_window'
inl:
name: window
item 1:
pointer: '0x558d61ddc800'
current_window: 1
number: 1
x: 14
y: 0
width: 259
height: 71
width_pct: 100
height_pct: 100
chat_x: 14
chat_y: 1
chat_width: 259
chat_height: 68
buffer: '0x558d61ea3e60'
start_line_y: 0
----
[[command_nicklist]]
@@ -436,12 +755,187 @@ Paramètres :
Exemples :
----
# demander la liste de pseudos pour tous les tampons
nicklist
* Demander la liste de pseudos pour tous les tampons :
# demander la liste de pseudos pour irc.freenode.#weechat
nicklist irc.freenode.#weechat
----
(nicklist_all) nicklist
----
Réponse :
[source,python]
----
id: 'nicklist_all'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea4120']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62840ea0', '0x558d61e75f90']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 4:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 6:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 7:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 8:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
item 9:
__path: ['0x558d62914680', '0x558d62afc4b0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
----
* Demander la liste de pseudos pour le tampon "irc.freenode.#weechat" :
----
(nicklist_weechat) nicklist irc.freenode.#weechat
----
Réponse :
[source,python]
----
id: 'nicklist_weechat'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 4:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 6:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
----
[[command_input]]
@@ -465,8 +959,15 @@ Paramètres :
Exemples :
* Envoyer la commande "/help filter" au tampon WeeChat core :
----
input core.weechat /help filter
----
* Envoyer le message "bonjour !" sur le canal #weechat :
----
input irc.freenode.#weechat bonjour !
----
@@ -511,17 +1012,19 @@ WeeChat répond avec un hdata :
En cas d'erreur, par exemple un tampon invalide ou une erreur interne du côté
de WeeChat, un hdata vide est retourné.
Exemple : complétion d'un paramètre de commande :
Exemples :
* Complétion d'un paramètre de commande :
----
(test) completion core.weechat -1 /help fi
(completion_help) completion core.weechat -1 /help fi
----
Réponse :
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {
'context': 'str',
@@ -547,17 +1050,17 @@ hda:
]
----
Exemple : complétion d'une commande au milieu d'un mot :
* Complétion d'une commande au milieu d'un mot :
----
(test) completion core.weechat 5 /quernick
(completion_query) completion core.weechat 5 /quernick
----
Réponse :
[source,python]
----
id: 'test'
id: 'completion_query'
hda:
keys: {
'context': 'str',
@@ -578,17 +1081,17 @@ hda:
list: ['query']
----
Exemple : rien à compléter :
* Rien à compléter :
----
(test) completion core.weechat -1 abcdefghijkl
(completion_abcdefghijkl) completion core.weechat -1 abcdefghijkl
----
Réponse :
[source,python]
----
id: 'test'
id: 'completion_abcdefghijkl'
hda:
keys: {
'context': 'str',
@@ -609,17 +1112,17 @@ hda:
list: []
----
Exemple : tampon invalide :
* Complétion sur un tampon invalide :
----
(test) completion buffer.does.not.exist -1 /help fi
(completion_help) completion buffer.does.not.exist -1 /help fi
----
Réponse :
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {}
path: ['completion']
@@ -664,21 +1167,31 @@ Paramètres :
Exemples :
* Synchroniser tous les tampons avec la liste de pseudos (les 3 commandes sont
équivalentes, mais la première est recommandée pour une compatibilité avec
les futures versions) :
----
# synchroniser tous les tampons avec la liste de pseudos
# (les 3 commandes sont équivalentes, mais la première est recommandée pour une
# compatibilité avec les futures versions)
sync
sync *
sync * buffers,upgrade,buffer,nicklist
----
# synchroniser le tampon "core"
* Synchroniser avec le tampon WeeChat core :
----
sync core.buffer
----
# synchroniser le canal #weechat, sans la liste de pseudos
* Synchroniser le canal #weechat, sans la liste de pseudos :
----
sync irc.freenode.#weechat buffer
----
# obtenir les signaux généraux + tous les signaux pour le canal #weechat
* Obtenir les signaux généraux + tous les signaux pour le canal #weechat :
----
sync * buffers,upgrade
sync irc.freenode.#weechat
----
@@ -719,19 +1232,25 @@ WeeChat (vous devez le retirer explicitement pour stopper les mises à jour).
Exemples :
* Désynchroniser tous les tampons (les 3 commandes sont équivalentes, mais la
première est recommandée pour une compatibilité avec les futures versions) :
----
# désynchroniser tous les tampons
# (les 3 commandes sont équivalentes, mais la première est recommandée pour une
# compatibilité avec les futures versions)
desync
desync *
desync * buffers,upgrade,buffer,nicklist
----
# désynchroniser la liste de pseudos pour le canal #weechat
# (garder les mises à jour du tampon)
* Désynchroniser la liste de pseudos pour le canal #weechat (garder les
mises à jour du tampon) :
----
desync irc.freenode.#weechat nicklist
----
# désynchroniser le canal #weechat
* Désynchroniser le canal #weechat :
----
desync irc.freenode.#weechat
----
@@ -743,21 +1262,10 @@ Commande de test : WeeChat répondra avec différents objets.
Cette commande est utile pour tester le décodage d'objets binaires retournés par
WeeChat.
[IMPORTANT]
Vous ne devez pas utiliser les pointeurs retournés par cette commande, ils ne
sont pas valides. Cette commande doit être utilisée seulement pour tester le
décodage d'un message envoyé par WeeChat.
Syntaxe :
----
test
----
Exemple :
----
test
(id) test
----
Objets retournés (dans cet ordre) :
@@ -782,6 +1290,38 @@ Objets retournés (dans cet ordre) :
| tableau d'entiers | arr int | [ 123, 456, 789 ]
|===
[IMPORTANT]
Vous ne devez pas utiliser les pointeurs retournés par cette commande, ils ne
sont pas valides. Cette commande doit être utilisée seulement pour tester le
décodage d'un message envoyé par WeeChat.
Exemple :
----
(test) test
----
Réponse :
----
id: 'test'
chr: 65
int: 123456
int: -123456
lon: 1234567890
lon: -1234567890
str: 'a string'
str: ''
str: None
buf: 'buffer'
buf: None
ptr: '0x1234abcd'
ptr: '0x0'
tim: 1321993456
arr: ['abc', 'de']
arr: [123, 456, 789]
----
[[command_ping]]
=== ping
@@ -805,6 +1345,13 @@ Exemple :
ping 1370802127000
----
Réponse :
----
id:'_pong'
str: '1370802127000'
----
[[command_quit]]
=== quit
@@ -1226,7 +1773,7 @@ hda:
'type': 'private',
'channel': 'FlashCode',
'nick': 'test',
'name': 'local.Flash2',
'name': 'freenode.Flash2',
}
----
+655 -100
View File
@@ -14,13 +14,12 @@
* Ryuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp>, 2014-2019
この文書は WeeChat リレープロトコルについて述べたものです: リレープロトコルとは、WeeChat
データをクライアントに中継するためのもので、多くの場合クライアントはリモートインターフェースを指します。
[[introduction]]
== はじめに
この文書は WeeChat リレープロトコルについて述べたものです: リレープロトコルとは、WeeChat
データをクライアントに中継するためのもので、多くの場合クライアントはリモートインターフェースを指します。
[[terminology]]
=== 用語
@@ -179,28 +178,65 @@ WeeChat replies with a hashtable containing the following keys and values:
and the user password (the _relay_ nonce + the client nonce is the salt used
in the password hash algorithm)
[TIP]
With WeeChat ≤ 2.8, the command _handshake_ is not implemented, WeeChat silently
ignores this command, even if it is sent before the _init_ command. +
So it is safe to send this command to any WeeChat version.
Examples:
* Nothing offered by the client, authentication password "plain" will be used
if allowed on relay side:
----
# nothing offered by the client (or only "plain"), authentication password "plain" will be used if allowed on relay side
handshake
handshake password_hash_algo=plain
# only plain, sha256 and pbkdf2+sha256 are supported by the client
handshake password_hash_algo=plain:sha256:pbkdf2+sha256
# only sha256 and sha512 are supported by the client, disable compression
handshake password_hash_algo=sha256:sha512,compression=off
(handshake) handshake
----
Example of response:
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo':
'pbkdf2+sha256',
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Only "plain" is supported by the client:
----
(handshake) handshake password_hash_algo=plain
----
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'plain',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
* Only "plain", "sha256" and "pbkdf2+sha256" are supported by the client:
----
(handshake) handshake password_hash_algo=plain:sha256:pbkdf2+sha256
----
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'pbkdf2+sha256',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
@@ -215,10 +251,24 @@ the password is "test" in this example:
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
[TIP]
With WeeChat ≤ 2.8, the command _handshake_ is not implemented, WeeChat silently
ignores this command, even if it is sent before the _init_ command. +
So it is safe to send this command to any WeeChat version.
* Only "sha256" and "sha512" are supported by the client, disable compression:
----
(handshake) handshake password_hash_algo=sha256:sha512,compression=off
----
Response:
[source,python]
----
id: 'handshake'
htb: {
'password_hash_algo': 'sha512',
'password_hash_iterations': '100000',
'totp': 'on',
'nonce': '85B1EE00695A5B254E14F4885538DF0D',
}
----
[[command_init]]
=== init
@@ -292,28 +342,44 @@ password as hexadecimal:
Hexadecimal strings can be lower or upper case, _relay_ can decode both.
// TRANSLATION MISSING
:
Examples:
* Initialize with password:
----
# デフォルト設定の zlib を使用する例 (WeeChat がサポートする場合)
init password=mypass
----
# パスワードにコンマを含む値を設定する例 (WeeChat バージョン 1.6 以上の場合)
* Initialize with commas in the password _(WeeChat ≥ 1.6)_:
----
init password=mypass\,with\,commas
----
# パスワードと TOTP を初期化する例 (WeeChat バージョン 2.4 以上の場合)
* Initialize with password and TOTP _(WeeChat ≥ 2.4)_:
----
init password=mypass,totp=123456
----
# 圧縮を使わない例
init password=mypass,compression=off
* Initialize with hashed password "test" (SHA256: salt=relay nonce + client nonce)
_(WeeChat ≥ 2.9)_:
# initialize with hashed password "test" (SHA256: salt=relay nonce + client nonce) (WeeChat バージョン 2.9 以上の場合)
----
init password_hash=sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:2c6ed12eb0109fca3aedc03bf03d9b6e804cd60a23e1731fd17794da423e21db
----
# initialize with hashed password "test" (SHA512: salt=relay nonce + client nonce) (WeeChat バージョン 2.9 以上の場合)
* Initialize with hashed password "test" (SHA512: salt=relay nonce + client nonce)
_(WeeChat ≥ 2.9)_:
----
init password_hash=sha512:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:0a1f0172a542916bd86e0cbceebc1c38ed791f6be246120452825f0d74ef1078c79e9812de8b0ab3dfaf598b6ca14522374ec6a8653a46df3f96a6b54ac1f0f8
----
# initialize with hashed password "test" (PBKDF2: SHA256, salt=relay nonce + client nonce, 100000 iterations) (WeeChat バージョン 2.9 以上の場合)
* Initialize with hashed password "test" (PBKDF2: SHA256, salt=relay nonce + client nonce,
100000 iterations) _(WeeChat ≥ 2.9)_:
----
init password_hash=pbkdf2+sha256:85b1ee00695a5b254e14f4885538df0da4b73207f5aae4:100000:ba7facc3edb89cd06ae810e29ced85980ff36de2bb596fcf513aaab626876440
----
@@ -352,22 +418,134 @@ WeeChat バージョン 1.6 以上では、hdata へのパスが無効または
hdata が返されます (<<object_hdata,hdata オブジェクト>>の例を参照してください)。 +
1.6 よりも古いバージョンでは、何も返されません。
例:
// TRANSLATION MISSING
Examples:
* Request "number" and "full_name" of all buffers:
----
# すべてのバッファを要求、"buffer" 型の hdata が返される
# それぞれのバッファについて "number" と "name" キーが返される
hdata buffer:gui_buffers(*) number,name
(hdata_buffers) hdata buffer:gui_buffers(*) number,full_name
----
# バッファの全ての行を要求、"line_data" 型の hdata が返される
# 全てのキーが返される
hdata buffer:gui_buffers(*)/lines/first_line(*)/data
Response:
# 最初のバッファの完全な名前を要求
hdata buffer:gui_buffers full_name
[source,python]
----
id: 'hdata_buffers'
hda:
keys: {
'number': 'int',
'full_name': 'str',
}
path: ['buffer']
item 1:
__path: ['0x558d61ea3e60']
number: 1
full_name: 'core.weechat'
item 2:
__path: ['0x558d62840ea0']
number: 1
full_name: 'irc.server.freenode'
item 3:
__path: ['0x558d62a9cea0']
number: 2
full_name: 'irc.freenode.#weechat'
----
# ホットリストの内容を要求
hdata hotlist:gui_hotlist(*)
* Request all lines of first buffer:
----
(hdata_lines) hdata buffer:gui_buffers/own_lines/first_line(*)/data
----
Response:
[source,python]
----
id: 'hdata_lines'
hda:
keys: {
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_printed': 'tim',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
'refresh_needed': 'chr',
'prefix': 'str',
'prefix_length': 'int',
'message': 'str',
}
path: ['buffer', 'lines', 'line', 'line_data']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d62920d80', '0x558d62abf040']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_printed: 1588404926
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the first line'
item 2:
__path: ['0x558d61ea3e60', '0x558d61ea40e0', '0x558d626779f0', '0x558d62af9700']
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_printed: 1588404930
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
displayed: 1
notify_level: 0
highlight: 0
refresh_needed: 0
prefix: ''
prefix_length: 0
message: 'this is the second line'
----
* Request the hotlist content:
----
(hdata_hotlist) hdata hotlist:gui_hotlist(*)
----
Response:
[source,python]
----
id: 'hdata_hotlist'
hda:
keys: {
'priority': 'int',
'creation_time.tv_sec': 'tim',
'creation_time.tv_usec': 'lon',
'buffer': 'ptr',
'count': 'arr',
'prev_hotlist': 'ptr',
'next_hotlist': 'ptr',
}
path: ['hotlist']
item 1:
__path: ['0x558d629601b0']
priority: 3
creation_time.tv_sec: 1588405398
creation_time.tv_usec: 355383
buffer: '0x558d62a9cea0'
count: [1, 1, 0, 1]
prev_hotlist: '0x0'
next_hotlist: '0x0'
----
[[command_info]]
@@ -385,10 +563,49 @@ _インフォ_ を要求。
* _name_: 読み出すインフォの名前
例:
// TRANSLATION MISSING
Examples:
* Request WeeChat version:
----
info version
(info_version) info version
----
Response:
[source,python]
----
id: 'info_version'
inf: ('version', '2.9-dev')
----
* Request WeeChat version as number:
----
(info_version_number) info version_number
----
Response:
[source,python]
----
id: 'info_version_number'
inf: ('version_number', '34144256')
----
* Request WeeChat directory:
----
(info_weechat_dir) info weechat_dir
----
Response:
[source,python]
----
id: 'info_weechat_dir'
inf: ('weechat_dir', '/home/xxx/.weechat')
----
[[command_infolist]]
@@ -413,10 +630,116 @@ _インフォリスト_ を要求。
* _pointer_: ポインタ (任意)
* _arguments_: 引数 (任意)
例:
// TRANSLATION MISSING
Examples:
* Request infolist "buffer":
----
infolist buffer
(infolist_buffer) infolist buffer
----
Response:
[source,python]
----
id: 'infolist_buffer'
inl:
name: buffer
item 1:
pointer: '0x558d61ea3e60'
current_buffer: 1
plugin: '0x0'
plugin_name: 'core'
number: 1
layout_number: 1
layout_number_merge_order: 0
name: 'weechat'
full_name: 'core.weechat'
old_full_name: None
short_name: 'weechat'
type: 0
notify: 3
num_displayed: 1
active: 1
hidden: 0
zoomed: 0
print_hooks_enabled: 1
day_change: 1
clear: 1
filter: 1
closing: 0
first_line_not_read: 0
lines_hidden: 0
prefix_max_length: 0
time_for_each_line: 1
nicklist_case_sensitive: 0
nicklist_display_groups: 1
nicklist_max_length: 0
nicklist_count: 0
nicklist_groups_count: 0
nicklist_nicks_count: 0
nicklist_visible_count: 0
title: 'WeeChat 2.9-dev (C) 2003-2020 - https://weechat.org/'
input: 1
input_get_unknown_commands: 0
input_get_empty: 0
input_buffer: ''
input_buffer_alloc: 256
input_buffer_size: 0
input_buffer_length: 0
input_buffer_pos: 0
input_buffer_1st_display: 0
num_history: 0
text_search: 0
text_search_exact: 0
text_search_regex: 0
text_search_regex_compiled: '0x0'
text_search_where: 0
text_search_found: 0
text_search_input: None
highlight_words: None
highlight_regex: None
highlight_regex_compiled: '0x0'
highlight_tags_restrict: None
highlight_tags: None
hotlist_max_level_nicks: None
keys_count: 0
localvar_name_00000: 'plugin'
localvar_value_00000: 'core'
localvar_name_00001: 'name'
localvar_value_00001: 'weechat'
----
* Request infolist "window":
----
(infolist_window) infolist window
----
Response:
[source,python]
----
id: 'infolist_window'
inl:
name: window
item 1:
pointer: '0x558d61ddc800'
current_window: 1
number: 1
x: 14
y: 0
width: 259
height: 71
width_pct: 100
height_pct: 100
chat_x: 14
chat_y: 1
chat_width: 259
chat_height: 68
buffer: '0x558d61ea3e60'
start_line_y: 0
----
[[command_nicklist]]
@@ -435,14 +758,190 @@ infolist buffer
* _buffer_: ポインタ (_0x12345_) またはバッファの完全な名前 (例:
_core.weechat_ または _irc.freenode.#weechat_)
例:
// TRANSLATION MISSING
Examples:
* Request nicklist for all buffers:
----
# 全てのバッファのニックネームリストを要求
nicklist
(nicklist_all) nicklist
----
# irc.freenode.#weechat のニックネームリストを要求
nicklist irc.freenode.#weechat
Response:
[source,python]
----
id: 'nicklist_all'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d61ea3e60', '0x558d61ea4120']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62840ea0', '0x558d61e75f90']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 4:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 6:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 7:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 8:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
item 9:
__path: ['0x558d62914680', '0x558d62afc4b0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
----
* Request nicklist for buffer "irc.freenode.#weechat":
----
(nicklist_weechat) nicklist irc.freenode.#weechat
----
Response:
[source,python]
----
id: 'nicklist_weechat'
hda:
keys: {
'group': 'chr',
'visible': 'chr',
'level': 'int',
'name': 'str',
'color': 'str',
'prefix': 'str',
'prefix_color': 'str',
}
path: ['buffer', 'nicklist_item']
item 1:
__path: ['0x558d62a9cea0', '0x558d62abf2e0']
group: 1
visible: 0
level: 0
name: 'root'
color: None
prefix: None
prefix_color: None
item 2:
__path: ['0x558d62a9cea0', '0x558d62afb9d0']
group: 1
visible: 1
level: 1
name: '000|o'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 3:
__path: ['0x558d62a9cea0', '0x558d62aff930']
group: 0
visible: 1
level: 0
name: 'FlashCode'
color: 'weechat.color.chat_nick_self'
prefix: '@'
prefix_color: 'lightgreen'
item 4:
__path: ['0x558d62a9cea0', '0x558d62af9930']
group: 1
visible: 1
level: 1
name: '001|v'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 5:
__path: ['0x558d62a9cea0', '0x558d62afc510']
group: 1
visible: 1
level: 1
name: '999|...'
color: 'weechat.color.nicklist_group'
prefix: None
prefix_color: None
item 6:
__path: ['0x558d62a9cea0', '0x558d6292c290']
group: 0
visible: 1
level: 0
name: 'flashy'
color: '142'
prefix: ' '
prefix_color: 'lightblue'
----
[[command_input]]
@@ -463,10 +962,17 @@ input <buffer> <data>
* _data_: バッファに送信するデータ: `/`
で始まる場合、バッファ内でコマンドとして実行されます、それ以外の場合、テキストはバッファの入力として送信されます。
:
Examples:
* Send command "/help filter" on WeeChat core bufer:
----
input core.weechat /help filter
----
* Send message "hello!" to #weechat channel:
----
input irc.freenode.#weechat hello!
----
@@ -512,17 +1018,19 @@ WeeChat replies with a hdata:
In case of error, for example invalid buffer or internal error on WeeChat side,
an empty hdata is returned.
Example: completion of a command argument:
Examples:
* Completion of a command argument:
----
(test) completion core.weechat -1 /help fi
(completion_help) completion core.weechat -1 /help fi
----
Response:
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {
'context': 'str',
@@ -534,31 +1042,31 @@ hda:
}
path: ['completion']
item 1:
__path: ['0x55d0ccc842c0']
context: 'command_arg'
base_word: 'fi'
pos_start: 6
pos_end: 7
add_space: 0
list: [
'fifo',
'fifo.file.enabled',
'fifo.file.path',
'filter',
]
__path: ['0x55d0ccc842c0']
context: 'command_arg'
base_word: 'fi'
pos_start: 6
pos_end: 7
add_space: 0
list: [
'fifo',
'fifo.file.enabled',
'fifo.file.path',
'filter',
]
----
Example: completion of a command in the middle of a word:
* Completion of a command in the middle of a word:
----
(test) completion core.weechat 5 /quernick
(completion_query) completion core.weechat 5 /quernick
----
Response:
[source,python]
----
id: 'test'
id: 'completion_query'
hda:
keys: {
'context': 'str',
@@ -579,17 +1087,17 @@ hda:
list: ['query']
----
Example: nothing to complete:
* Nothing to complete:
----
(test) completion core.weechat -1 abcdefghijkl
(completion_abcdefghijkl) completion core.weechat -1 abcdefghijkl
----
Response:
[source,python]
----
id: 'test'
id: 'completion_abcdefghijkl'
hda:
keys: {
'context': 'str',
@@ -610,17 +1118,17 @@ hda:
list: []
----
Example: invalid buffer:
* Completion on an invalid buffer:
----
(test) completion buffer.does.not.exist -1 /help fi
(completion_help) completion buffer.does.not.exist -1 /help fi
----
Response:
[source,python]
----
id: 'test'
id: 'completion_help'
hda:
keys: {}
path: ['completion']
@@ -662,23 +1170,33 @@ sync [<buffer>[,<buffer>...] <option>[,<option>...]]
と同じバッファに関するシグナル) _(WeeChat バージョン 0.4.1 で更新)_
** _nicklist_: 変更後にニックネームリストを受信
例:
// TRANSLATION MISSING
Examples:
* Synchronize all buffers with nicklist (the 3 commands are equivalent,
but the first one is recommended for compatibility with future versions):
----
# ニックネームリストを持つ全てのバッファを同期
# (3 つのコマンドは全て等価ですが、
# 将来のバージョンとの互換性を考慮して 1 つ目のコマンドを推奨します)
sync
sync *
sync * buffers,upgrade,buffer,nicklist
----
# コアバッファを同期
* Synchronize WeeChat core buffer:
----
sync core.buffer
----
# #weechat チャンネルを同期、ニックネームリストは受信しない
* Synchronize #weechat channel, without nicklist:
----
sync irc.freenode.#weechat buffer
----
# 一般的なシグナル + #weechat チャンネルに対する全てのシグナルを取得
* Get general signals + all signals for #weechat channel:
----
sync * buffers,upgrade
sync irc.freenode.#weechat
----
@@ -715,20 +1233,27 @@ buffer に "*" を指定した場合、(名前を使って) 同期されてい
は #weechat チャンネルに対するアップデートを送信し続けます
(アップデートを止めるには、明示してこれを中止しなければいけません)。
例:
// TRANSLATION MISSING
Examples:
* Desynchronize all buffers (the 3 commands are equivalent, but the first one
is recommended for compatibility with future versions):
----
# ニックネームリストを持つ全てのバッファの同期を中止
# (3 つのコマンドは全て等価ですが、
# 将来のバージョンとの互換性を考慮して 1 つ目のコマンドを推奨します)
desync
desync *
desync * buffers,upgrade,buffer,nicklist
----
# #weechat チャンネルのニックネームリストの同期を中止 (バッファは同期する)
* Desynchronize nicklist for #weechat channel (keep buffer updates):
----
desync irc.freenode.#weechat nicklist
----
# #weechat チャンネルの同期を中止
* Desynchronize #weechat channel:
----
desync irc.freenode.#weechat
----
@@ -740,21 +1265,10 @@ desync irc.freenode.#weechat
このコマンドは WeeChat
が返すバイナリオブジェクトのデコーディングをテストする際に便利です。
[IMPORTANT]
このコマンドが返したポインタ値を絶対に使ってはいけません、ポインタ値は無効です。このコマンドを
WeeChat
が返すメッセージのデコーディングをテストする場合以外に使わないでください。
構文:
----
test
----
例:
----
test
(id) test
----
返されるオブジェクト (以下の順番):
@@ -779,6 +1293,39 @@ test
| integer の配列 | arr int | [ 123, 456, 789 ]
|===
[IMPORTANT]
このコマンドが返したポインタ値を絶対に使ってはいけません、ポインタ値は無効です。このコマンドを
WeeChat
が返すメッセージのデコーディングをテストする場合以外に使わないでください。
例:
----
(test) test
----
// TRANSLATION MISSING
Response:
----
id: 'test'
chr: 65
int: 123456
int: -123456
lon: 1234567890
lon: -1234567890
str: 'a string'
str: ''
str: None
buf: 'buffer'
buf: None
ptr: '0x1234abcd'
ptr: '0x0'
tim: 1321993456
arr: ['abc', 'de']
arr: [123, 456, 789]
----
[[command_ping]]
=== ping
@@ -801,6 +1348,14 @@ ping [<arguments>]
ping 1370802127000
----
// TRANSLATION MISSING
Response:
----
id:'_pong'
str: '1370802127000'
----
[[command_quit]]
=== quit
@@ -1218,7 +1773,7 @@ hda:
'type': 'private',
'channel': 'FlashCode',
'nick': 'test',
'name': 'local.Flash2',
'name': 'freenode.Flash2',
}
----