Matrix txnid fix (#12057)

* Fix Matrix alerting txnid

This fixes the issue I brought up in #12018.  I can confirm that I now get a new message from the LibreNMS bot every time I test my Matrix transport.

* Update AUTHORS.md
This commit is contained in:
thomcatdotrocks
2020-09-04 09:38:19 -05:00
committed by GitHub
parent 19cb90439c
commit dfab530525
2 changed files with 3 additions and 1 deletions

View File

@@ -43,9 +43,10 @@ class Matrix extends Transport
{
$request_opts = [];
$request_heads = [];
$txnid = rand(1111, 9999) . time();
$server = preg_replace('/\/$/', '', $server);
$host = $server."/_matrix/client/r0/rooms/".urlencode($room)."/send/m.room.message/".$obj['uid'];
$host = $server."/_matrix/client/r0/rooms/".urlencode($room)."/send/m.room.message/".$txnid;
$request_heads['Authorization'] = "Bearer $authtoken";
$request_heads['Content-Type'] = "application/json";