Nheko-Reborn / mtxclient

Client API library for Matrix, built on top of libcurl
MIT License
40 stars 25 forks source link

Actually read out rule_id in PushRule's from_json #70

Closed Thulinma closed 3 years ago

Thulinma commented 3 years ago

Fixes missing parsing for rule_id. Generating was already implemented, looks like this was simply a forgotten line.

deepbluev7 commented 3 years ago

So, if you want to be fancy, you could add a test for this :3

Thulinma commented 3 years ago

I could, yes. If somebody had written a test for this to begin with, perhaps there would not have been a bug, even! 😏

Thulinma commented 3 years ago

Test added. Just ensures pushrules's from_json and to_json are identical; which is a pretty simplistic test, but I can confirm it fails without the fix. So... good enough, I say!