Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
ff41271a
by wurstsalat at 2022-10-27T23:18:52+02:00
1 changed file:
Changes:
| ... | ... | @@ -41,12 +41,15 @@ def __init__(self, account: str, selectable: bool = True) -> None: |
| 41 | 41 | self._selectable = selectable
|
| 42 | 42 | |
| 43 | 43 | self._content = cast(ContentT, None)
|
| 44 | + self._action_phrase_text = ''
|
|
| 44 | 45 | |
| 45 | 46 | def get_content(self) -> ContentT:
|
| 46 | 47 | return self._content
|
| 47 | 48 | |
| 48 | 49 | def get_text(self) -> str:
|
| 49 | - return self._content.text
|
|
| 50 | + if self._content is not None:
|
|
| 51 | + return self._content.text
|
|
| 52 | + return self._action_phrase_text
|
|
| 50 | 53 | |
| 51 | 54 | def add_with_styling(self,
|
| 52 | 55 | text: str,
|
| ... | ... | @@ -66,6 +69,8 @@ def _add_action_phrase(self, text: str, nickname: str): |
| 66 | 69 | widget.show_all()
|
| 67 | 70 | self.add(widget)
|
| 68 | 71 | |
| 72 | + self._action_phrase_text = text.replace('/me', f'* {nickname}', 1)
|
|
| 73 | + |
|
| 69 | 74 | def add_content(self, content: ContentT) -> None:
|
| 70 | 75 | self.clear()
|
| 71 | 76 | self._content = content
|