Microsoft Teams: Patch Missing Conversations

Hot patch "missing conversations" bug where threads are truncated at 2-3 replies

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Microsoft Teams: Patch Missing Conversations
// @namespace   http://www.asaurus.net/
// @description Hot patch "missing conversations" bug where threads are truncated at 2-3 replies
//              and old threads won't populate, after a channel switch.
//              Author: Kevin Buhr <[email protected]>
// @match       https://teams.microsoft.com/*
// @version     1.1
// @grant       none
// @license     Public Domain
// ==/UserScript==

var prefix = "Patch Missing Conversations: ";
(function loop() {
	var mp = unsafeWindow.angular && unsafeWindow.angular.element("message-pane");
 	var ct = mp && mp.controller && mp.controller("messagePane");
  if (ct) {
    var cp = ct.constructor.prototype;
    if (cp.initialize.patched) {
      console.log(prefix+"patch already applied");
    } else {
      var oldinitialize = cp.initialize;
      var initialize = function() {
        var that = this.wrappedJSObject || this;
        if (that.context === '') return;
        oldinitialize.call(that);
      }
      initialize.patched = 1;
      cp.initialize = exportFunction(initialize, cp);
    	console.log(prefix+"patch applied");
 	 }
	} else {
  	setTimeout(loop, 1000);
  }
})();