Commits
- Commit:
359feeefd89573d37f03bb838705341f240b5195- From:
- Murilo Ijanc <murilo@ijanc.org>
- Date:
Use vendored http library for HTTPS.
- replace the libtls Conn, the ffi module, and the inline HTTP
formatter with http::post
- slack_post is six lines; parse_ok takes &str because http:: decodes
Content-Length and Transfer-Encoding internally
- drop -C link-arg=-ltls; vendor/http.rs carries #[link(name = "tls")]
which propagates to dependents
- vendor http at ssh://ijanc@ijanc.org/http commit ebd3a89
- Commit:
f0b13cc7907aa4956f3ddb6bc9d1d0582ba9f24a- From:
- Murilo Ijanc <murilo.ijanc@kovi.com.br>
- Date:
Auto-detect Block Kit payloads and post as blocks.
If the message parses as a non-empty JSON array whose first
element is an object with a string "type" field, send it as a
"blocks" payload with a static fallback "text" for push and
legacy notifications. Any other input, including messages that
happen to be valid JSON but do not match that shape, is sent
verbatim as text.
- Commit:
a9801d55e62952ed925510ec98eda85d55316cc8- From:
- Murilo Ijanc <murilo.ijanc@kovi.com.br>
- Date:
Use vendored jackson library for request and response JSON.
Drop the hand-rolled json_escape() and the substring-based response
scanner in favor of jackson's json_struct! macro. PostMessage and
PostResponse capture the wire format as plain Rust structs and the
generated ToJson/FromJson impls handle (de)serialisation, including
escapes and optional fields via Option<T>.
jackson lives under vendor/ as a single file and is built as a
separate rlib linked via --extern, so sm.rs is still one rustc
invocation away from a binary. vendor/VENDOR records the upstream
commit so updates are a straightforward re-copy.
- Commit:
e678f0f29294a33d774f58298da8658035b1e6cb- From:
- Murilo Ijanc <murilo.ijanc@kovi.com.br>
- Date:
Document the Slack mrkdwn formatting that is handled server-side.
sm transmits the message body verbatim and Slack renders it using
its own mrkdwn variant, which is similar to but not identical to
CommonMark. Add a matching FORMATTING section to README.md and
sm.1 pointing at the upstream reference so callers do not assume
CommonMark syntax.
Also exclude the local channels scratch file from the working
tree.
- Commit:
6f43b0407ec7a6da3018fd81c2d678c078d1f84a- From:
- Murilo Ijanc <murilo.ijanc@kovi.com.br>
- Date:
Initial import of sm, a minimal Slack message CLI.
sm posts a single message to a Slack channel through the
chat.postMessage API. TLS is provided by libtls over a raw TCP
stream, and JSON is generated and parsed inline so there are no
crate dependencies beyond the Rust standard library.
The channel id and the message come from argv; a message of "-"
is read from standard input. The token is taken from the
SLACK_USER_TOKEN environment variable. sm exits 0 on success;
on failure it exits non-zero and writes a diagnostic to standard
error, distinguishing input, transport, and API errors.
