[docs]defadd_quoted_fallback(self,fallback:str,nickname:Optional[str]=None):r""" Add plain text fallback for clients not implementing XEP-0461. ``msg["reply"].add_quoted_fallback("Some text", "Bob")`` will prepend ``> Bob:\n> Some text\n`` to the body of the message, and set the fallback_body attributes accordingly, so that clients implementing XEP-0461 can hide the fallback text. :param fallback: Body of the quoted message. :param nickname: Optional, nickname of the quoted participant. """msg=self.parent()quoted="\n".join("> "+x.strip()forxinfallback.split("\n"))+"\n"ifnickname:quoted="> "+nickname+":\n"+quotedmsg["body"]=quoted+msg["body"]fallback_elem=Fallback()fallback_elem["for"]=NSfallback_elem["body"]["start"]=0fallback_elem["body"]["end"]=len(quoted)msg.append(fallback_elem)