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:
parent
19cb90439c
commit
dfab530525
|
@ -215,6 +215,7 @@ LibreNMS contributors:
|
||||||
- Pavle Obradovic <pobradovic08@gmail.com> (pobradovic08)
|
- Pavle Obradovic <pobradovic08@gmail.com> (pobradovic08)
|
||||||
- Jason Cheng <sanyu3u@gmail.com> (jasoncheng7115)
|
- Jason Cheng <sanyu3u@gmail.com> (jasoncheng7115)
|
||||||
- Daniel Baeza <doctoruve@gmail.com> (TheGreatDoc)
|
- Daniel Baeza <doctoruve@gmail.com> (TheGreatDoc)
|
||||||
|
- Thom Cleary <me@thomcat.rocks> (thomcatdotrocks)
|
||||||
|
|
||||||
Observium was written by:
|
Observium was written by:
|
||||||
- Adam Armstrong
|
- Adam Armstrong
|
||||||
|
|
|
@ -43,9 +43,10 @@ class Matrix extends Transport
|
||||||
{
|
{
|
||||||
$request_opts = [];
|
$request_opts = [];
|
||||||
$request_heads = [];
|
$request_heads = [];
|
||||||
|
$txnid = rand(1111, 9999) . time();
|
||||||
|
|
||||||
$server = preg_replace('/\/$/', '', $server);
|
$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['Authorization'] = "Bearer $authtoken";
|
||||||
$request_heads['Content-Type'] = "application/json";
|
$request_heads['Content-Type'] = "application/json";
|
||||||
|
|
Loading…
Reference in New Issue