Skip to content

Commit 05d7a33

Browse files
authored
Merge pull request #579 from TotallyNotRobots/fix-tellinput-read
Make sure to .commit() updated tells in tellinput
2 parents 3a49ddc + 57261e1 commit 05d7a33

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

plugins/tell.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ def tellinput(conn, db, nick, notice, content):
312312
notice(reply)
313313

314314
first_tell.mark_read()
315+
db.commit()
316+
load_cache(db)
315317

316318

317319
@hook.command(autohelp=False)

tests/plugin_tests/test_tell.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,38 @@ def test_tellinput_multiple(mock_db, freeze_time):
358358
"foo sent you a message 0 minutes ago: bar (+2 more, .showtells to view)"
359359
)
360360
]
361+
assert mock_db.get_data(tell.TellMessage.__table__) == [
362+
(
363+
1,
364+
"testconn",
365+
"foo",
366+
"other",
367+
"bar",
368+
True,
369+
datetime.datetime(2019, 8, 22, 13, 14, 36),
370+
datetime.datetime(2019, 8, 22, 13, 14, 36),
371+
),
372+
(
373+
2,
374+
"testconn",
375+
"foo",
376+
"other",
377+
"test",
378+
False,
379+
datetime.datetime(2019, 8, 22, 13, 14, 36),
380+
None,
381+
),
382+
(
383+
3,
384+
"testconn",
385+
"foo",
386+
"other",
387+
"z",
388+
False,
389+
datetime.datetime(2019, 8, 22, 13, 14, 36),
390+
None,
391+
),
392+
]
361393

362394

363395
def test_can_send_to_user(mock_db, freeze_time):

0 commit comments

Comments
 (0)