Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dsci4-hacks/a70dd14b4628d1203c57aab16d377930 to your computer and use it in GitHub Desktop.
Save dsci4-hacks/a70dd14b4628d1203c57aab16d377930 to your computer and use it in GitHub Desktop.
Delete batch messages Microsoft Teams
/*
By kiki67100 https://gist.github.com/kiki67100
Tested on Google Chrome
Open Microsoft teams web version, select a conversation
Open Developper tools and copy / paste (Change YOUR_NAME by your)
Work on March 2020 maybe no work on the future...
*/
window.id = [];
YOUR_NAME = "YOUR_NAME";
window.idx=0;
setInterval(function() {
jQuery('#page-content-wrapper').find('div[id^=m]').each(function() {
$('virtual-repeat').scrollTop(0);
setTimeout(function(_this) {
//console.log('timeout...');
//console.log('_this = ',_this);
txt = $(_this).text();
if (txt.indexOf(YOUR_NAME) != -1) {
console.log('not inside');
$(_this).css({
'outline': '1px solid red'
});
_id = $(_this).attr('id');
//console.log('_this id =' + _id)
if (window.id.indexOf(_id) == -1) {
window.id.push(_id.substr(1));
//console.log('add');
} else {
//console.log('!!');
}
}else{
//console.log('already inside');
}
}, 1000, this);
});
}, 2000);
/*
- Extract messages id
On Google Chrome developper tools :
copy(id.join("\n"))
Delete a message, copy the ajax request and export as CURL (bash) (on network tools maybe end by "softDelete")
On notepad ++ on replace regex mode
REPLACE (.*)
Your CURL shell command find the id curl 'https://emea.[...]/121545326566?behavior=softDelete by $1 like this 'https://emea.[...]/$1?behavior=softDelete
lauch on linux terminal all lines
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment