From: Hellbent
To: Hellbent
I wish that I could say that I've only ever done that once.
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
Let's assume that you and I are talking in a PM and I reply to you, then a min after I have sent my reply I notice that I forgot to mention something so I hit the reply button again (this time it is my last message that is on the screen). Instead of it sending the message to you, it sends it to me and if I am not paying attention I would assume that you will get the message but you never will.
Code: Select all
// ==UserScript==
// @name AHK Confirm send PM if author is recepient
// @description for AHK forum PM page
// @version 1
// @grant none
// @icon https://www.autohotkey.com/static/ahk76.png
// @match https://www.autohotkey.com/boards/ucp.php?i=pm&mode=compose*
// @match http://www.autohotkey.com/boards/ucp.php?i=pm&mode=compose*
// @match https://autohotkey.com/boards/ucp.php?i=pm&mode=compose*
// @match http://autohotkey.com/boards/ucp.php?i=pm&mode=compose*
// ==/UserScript==
var USERNAME = "Hellbent";
var btnSubmit = document.querySelector('.submit-buttons input[type=submit].default-submit-action');
if (btnSubmit != null)
{
btnSubmit.onclick = function()
{
try
{
var recipients = document.querySelector('ul.recipients').innerText.split('\n').map( x => x.trim() );
if (recipients.indexOf(USERNAME) >= 0)
{
return confirm('Are you sure you want to send this PM? It seems you are a recipient as well...');
}
}
catch(e)
{
console.warn('AHK-userscript: Could not get recipients ...');
}
return false;
};
}
Users browsing this forum: No registered users and 31 guests