This commit is contained in:
spla 2020-12-03 19:20:48 +01:00
pare a5dc281cea
commit 27bc472be5

Veure arxiu

@ -681,7 +681,7 @@ def send_anotation(game_id):
return (emailed, game_id, game_found) return (emailed, game_id, game_found)
def close_game(username): def close_game(username, checkmate):
try: try:
@ -729,6 +729,10 @@ def close_game(username):
winner = 'none' winner = 'none'
if checkmate:
winner = username
else: else:
if query_word == search_end and username == white_user and stalemate == False: if query_word == search_end and username == white_user and stalemate == False:
@ -1592,12 +1596,12 @@ if __name__ == '__main__':
game_moves = board.ply() game_moves = board.ply()
close_game(username)
if stalemate == False: if stalemate == False:
checkmate = True checkmate = True
close_game(username, checkmate)
else: else:
checkmate = False checkmate = False
@ -1718,6 +1722,8 @@ if __name__ == '__main__':
stalemate = False stalemate = False
checkmate = False
if black_user != '': if black_user != '':
if username == white_user: if username == white_user:
@ -1726,7 +1732,7 @@ if __name__ == '__main__':
mastodon.status_post(toot_text, in_reply_to_id=status_id,visibility=visibility) mastodon.status_post(toot_text, in_reply_to_id=status_id,visibility=visibility)
close_game(username) close_game(username, checkmate)
update_replies(status_id, username, now) update_replies(status_id, username, now)
@ -1740,7 +1746,7 @@ if __name__ == '__main__':
mastodon.status_post(toot_text, in_reply_to_id=status_id,visibility=visibility) mastodon.status_post(toot_text, in_reply_to_id=status_id,visibility=visibility)
close_game(username) close_game(username, checkmate)
update_replies(status_id, username, now) update_replies(status_id, username, now)
@ -1754,7 +1760,7 @@ if __name__ == '__main__':
mastodon.status_post(toot_text, in_reply_to_id=status_id, visibility=visibility) mastodon.status_post(toot_text, in_reply_to_id=status_id, visibility=visibility)
close_game(username) close_game(username, checkmate)
update_replies(status_id, username, now) update_replies(status_id, username, now)