Skip to content

Commit

Permalink
api: add function hook_line
Browse files Browse the repository at this point in the history
  • Loading branch information
flashcode committed Aug 12, 2018
1 parent 12a6f74 commit 42be1a7
Show file tree
Hide file tree
Showing 47 changed files with 3,820 additions and 1,210 deletions.
1 change: 1 addition & 0 deletions ChangeLog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
New features::

* core: allow partial buffer name in command /buffer close (issue #1226)
* api: add function hook_line

Bug fixes::

Expand Down
1 change: 1 addition & 0 deletions doc/de/weechat_scripting.de.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ Liste der Skript API Funktionen:
hook_process +
hook_process_hashtable +
hook_connect +
hook_line +
hook_print +
hook_signal +
hook_signal_send +
Expand Down
62 changes: 58 additions & 4 deletions doc/de/weechat_user.de.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3619,8 +3619,8 @@ Ein Trigger hat folgende Optionen (Benennung ist
| enabled | `on`, `off` |
Wenn die Option auf `off` gesetzt ist, dann ist der Trigger deaktiviert und die Ausführung ist gestoppt.

| hook | `signal`, `hsignal`, `modifier`, `print`, `command`, `command_run`,
`timer`, `config`, `focus` |
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
`command_run`, `timer`, `config`, `focus` |
Der hook welcher durch Trigger genutzt werden soll. Für weitere Informationen siehe
link:weechat_plugin_api.en.html#hooks[Anleitung für API Erweiterung / Hooks] (Englisch).

Expand Down Expand Up @@ -3710,6 +3710,18 @@ ein Semikolon getrennt.
`+5000\|input_text_display;5000\|history_add+` |
link:weechat_plugin_api.en.html#_hook_modifier[hook_modifier] (Englisch)

// TRANSLATION MISSING
| line |
1. buffer type +
2. buffer name +
3. tags |
`+formatted+` +
`+free+` +
`+*;irc.freenode.*+` +
`+*;irc.freenode.#weechat+` +
`+formatted;irc.freenode.#weechat;irc_notice+` |
link:weechat_plugin_api.en.html#_hook_line[hook_line]

| print |
1. Buffername +
2. Tags +
Expand Down Expand Up @@ -3795,6 +3807,7 @@ welche abhängig von dem genutzten Hook ist:
| signal | tg_signal_data
| hsignal |
| modifier | tg_string
| line | message
| print | tg_message
| command | tg_argv_eol1
| command_run | tg_command
Expand Down Expand Up @@ -3962,6 +3975,46 @@ vorhanden sind (siehe <<trigger_data_print,hook print>> weiter unten), und nachf
Sollte das Signal eine IRC Nachricht beinhalten, wird die Nachricht analysiert
und die Daten in einer Hashtable gesichert (siehe <<trigger_data_signal,hook signal>>).

[[trigger_data_line]]
===== Line

Der Callback von "line" legt folgende Variablen in der Hashtable an:

// TRANSLATION MISSING
[width="100%",cols="3m,2,14",options="header"]
|===
| Variable | Typ | Beschreibung
| buffer | pointer | Buffer.
| buffer_name | string | Buffer name.
| buffer_type | string | Buffer type ("formatted" or "free").
| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content.
| date | string | Line date (timestamp).
| date_printed | string | Date when line was displayed (timestamp).
| str_time | string | Date for display. It may contain color codes.
| displayed | string | "1" if displayed, "0" if line filtered.
| notify_level | string | "0" = low level, "1" = message, "2" = private message, "3" = highlight
| highlight | string | "1" if highlight, otherwise "0".
| prefix | string | Prefix.
| message | string | Message.
|===

// TRANSLATION MISSING
Variables set using tags in message (they are also set in _print_ callback and
modifier _weechat_print_):

[width="100%",cols="3m,2,14",options="header"]
|===
| Variable | Typ | Beschreibung
| tg_tags | string | Tags einer Nachricht (Komma wird automatisch zu Beginn und Ende den Tags hinzugefügt).
| tg_tags_count | string | Anzahl an Tags der Nachricht.
| tg_tag_nick | string | Nick (extrahiert aus Tag "nick_xxx").
| tg_tag_prefix_nick | string | Nickfarbe für Präfix (extrahier aus Tag "prefix_nick_ccc").
| tg_tag_host | string | Username und Host, Format: username@host (extrahiert aus Tag "host_xxx").
| tg_tag_notify | string | Benachrichtigungsstufe (_none_, _message_, _private_, _highlight_).
| tg_notify | string | Benachrichtigungsstufe, falls von _none_ abweichend.
| tg_msg_pv | string | "1" für eine private Nachricht, andernfalls "0".
|===

[[trigger_data_print]]
===== Print

Expand All @@ -3980,8 +4033,9 @@ Der Callback von "print" legt folgende Variablen in der Hashtable an:
| tg_message_nocolor | string | Nachricht ohne Farbcodes.
|===

Variablen welche gesetzt werden, aufgrund der Nutzung von Tags in einer Nachricht
(_weechat_print_ nutzt ebenso diese Tag-Variablen):
// TRANSLATION MISSING
Variables set using tags in message (they are also set in _line_ callback and
modifier _weechat_print_):

[width="100%",cols="3m,2,14",options="header"]
|===
Expand Down
Loading

0 comments on commit 42be1a7

Please sign in to comment.