Mutes thread mentions

        :param mute: Boolean. True to mute, False to unmute
        :param thread_id: User/Group ID to mute. See :ref:`intro_threads`
499402
def muteThreadMentions(self, mute=True, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)
        data = {"mentions_mute_mode": int(mute), "thread_fbid": thread_id}
        r = self._post(self.req_url.MUTE_MENTIONS, data, fix_request=True)
61239
def threadid(self):
        
        current = self.thread.ident
        main = get_main_thread()
        if main is None:
            return current
        else:
            return current if current != main.ident else None
821888
def changeThreadColor(self, color, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)

        data = {
            "color_choice": color.value if color != ThreadColor.MESSENGER_BLUE else "",
            "thread_or_other_fbid": thread_id,
        }
        j = self._post(self.req_url.THREAD_COLOR, data, fix_request=True, as_json=True)
181884
def _getThread(self, given_thread_id=None, given_thread_type=None):
        
        if given_thread_id is None:
            if self._default_thread_id is not None:
                return self._default_thread_id, self._default_thread_type
            else:
                raise ValueError("Thread ID is not set")
        else:
            return given_thread_id, given_thread_type
858018
def toggleMute(self):
        

        if not self.muted:
            self._mute()
            if self.delay_thread is not None:
                self.delay_thread.cancel()
            self.title_prefix = '[Muted] '
            self.muted = True
            self.show_volume = False
        else:
            self._mute()
            self.title_prefix = ''
            self.muted = False
            self.show_volume = True
        if self.oldUserInput['Title'] == '':
            self.outputStream.write(self.title_prefix + self._format_title_string(self.oldUserInput['Input']))
        else:
            self.outputStream.write(self.title_prefix + self._format_title_string(self.oldUserInput['Title']))
74269
def mute_modmail_author(self, _unmute=False):
        
        path = 'unmute_sender' if _unmute else 'mute_sender'
        return self.reddit_session.request_json(
            self.reddit_session.config[path], data={'id': self.fullname})
1210628
def _close_thread(self, thread, thread_name):
        
        if thread is not None and thread.isAlive():
            self.logger.debug("Waiting for {} thread to close".format(thread_name))
            thread.join(timeout=self.settings['DAEMON_THREAD_JOIN_TIMEOUT'])
            if thread.isAlive():
                self.logger.warn("{} daemon thread unable to be shutdown"
                                 " within timeout".format(thread_name))
421241
def muteThreadReactions(self, mute=True, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)
        data = {"reactions_mute_mode": int(mute), "thread_fbid": thread_id}
        r = self._post(self.req_url.MUTE_REACTIONS, data, fix_request=True)
990800
def mute_stdio(self) -> None:
        

        # The benefit of using a Filter here for disabling messages is that we do not have to restore old logging levels.
        for logger in self.loggers.values():
            if logger.hasHandlers():
                logger.handlers[0].addFilter(self.block_all_filter)
496189
def __listeners_for_thread(self):
        """"""

        thread = get_thread_ident()
        with self.lock:
            return [l for tid, l in self.listeners.items() if tid == thread]
449747
def status_mute(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/statuses/{0}/mute'.format(str(id))
        return self.__api_request('POST', url)
957949
def get_current_thread_id(thread):
    '''
    
    '''
    try:
        # Fast path without getting lock.
        tid = thread.__pydevd_id__
        if tid is None:
            # Fix for https://www.brainwy.com/tracker/PyDev/645
            # if __pydevd_id__ is None, recalculate it... also, use an heuristic
            # that gives us always the same id for the thread (using thread.ident or id(thread)).
            raise AttributeError()
    except AttributeError:
        tid = _get_or_compute_thread_id_with_lock(thread, is_current_thread=True)

    return tid
709300
def _mainthread_poll_readable(self):
        
        events = self._recv_selector.select(self.block_time)
        for key, mask in events:
            if mask == selectors.EVENT_READ:
                self._recv_selector.unregister(key.fileobj)

                self._threads_limiter.start_thread(target=self._subthread_handle_readable,
                                                   args=(key.fileobj,))
484881
async def pin(self, disable_notification: bool = False):
        
        return await self.chat.pin_message(self.message_id, disable_notification)
427472
def silence(cls, *modules, **kwargs):
        
        level = kwargs.pop("level", logging.WARNING)
        for mod in modules:
            name = mod.__name__ if hasattr(mod, "__name__") else mod
            logging.getLogger(name).setLevel(level)
355029
def thread_debug(self, *args, **kwargs):
        
        if 'module' not in kwargs:
            kwargs['module'] = "Monitor"
        if kwargs['module'] != 'Monitor' and self.do_DEBUG(module='Monitor'):
            self.debug[kwargs['module']] = True
        if not self.do_DEBUG(module=kwargs['module']):
            return
        thread_id = threading.current_thread().name
        key = "[" + thread_id + "] " + kwargs['module']
        if not self.debug.get(key):
            self.debug[key] = True
        kwargs['module'] = key
        self.DEBUG(*args, **kwargs)
1294537
protected void notifyObservers (final Name username, final boolean muted)
    {
        _observers.apply(new ObserverList.ObserverOp<MuteObserver>() {
            public boolean apply (MuteObserver observer) {
                observer.muteChanged(username, muted);
                return true;
            }
        });
    }