Skip to content

Commit

Permalink
Send context when banning via [M], fixes #209
Browse files Browse the repository at this point in the history
  • Loading branch information
eritbh committed Feb 9, 2020
1 parent 01bda99 commit 5f34ec0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extension/data/modules/modbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ function modbutton () {
$status = $popup.find('.status'),
banReason = $popup.find('.ban-note').val(),
banDuration = $popup.find('.ban-duration').val(),
banContext = $popup.find('.thing_id').text(),
subreddits = [],
user = $popup.find('.user').text();

Expand Down Expand Up @@ -603,6 +604,7 @@ function modbutton () {
banReason,
banMessage,
banDuration,
banContext,
}).then(response => {
if (!$.isEmptyObject(response) && !$.isEmptyObject(response.json.errors) && response.json.errors[0][0] === 'USER_BAN_NO_MESSAGE') {
// There is probably a smarter way of doing this that doesn't involve nesting another api call within an api call.
Expand All @@ -616,6 +618,7 @@ function modbutton () {
banReason,
banMessage,
banDuration,
banContext,
}).then(success => {
if (!success) {
self.log('missed one');
Expand Down

0 comments on commit 5f34ec0

Please sign in to comment.