Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
a0f78d3b by wurstsalat at 2021-11-16T16:22:35+01:00
Notifications: Display file type and file name
- - - - -
1 changed file:
- gajim/gtk/controls/base.py
Changes:
=====================================
gajim/gtk/controls/base.py
=====================================
@@ -23,6 +23,8 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+from typing import Optional
+
import os
import sys
import time
@@ -46,6 +48,8 @@
from gajim.common.helpers import AdditionalDataDict
from gajim.common.helpers import get_retraction_text
from gajim.common.const import KindConstant
+from gajim.common.preview_helpers import filename_from_uri
+from gajim.common.preview_helpers import guess_simple_file_type
from gajim.common.structs import OutgoingMessage
from gajim.gui.conversation.view import ConversationView
@@ -1156,7 +1160,7 @@ def add_message(self,
# Issue notification
if notify:
- self._notify(name, text, tim)
+ self._notify(name, text, tim, additional_data)
# Send chat marker if we’re actively following the chat
chat_active = app.window.is_chat_active(
@@ -1164,13 +1168,24 @@ def add_message(self,
if chat_active and self._scrolled_view.get_autoscroll():
app.window.mark_as_read(self.account, self.contact.jid)
- def _notify(self, name, text, tim):
+ def _notify(self, name: str, text: str, tim: Optional[int],
+ additional_data: AdditionalDataDict) -> None:
if app.window.is_chat_active(self.account, self.contact.jid):
if self._scrolled_view.get_autoscroll():
return
title = _('New message from %s') % name
+ is_previewable = app.interface.preview_manager.get_previewable(
+ text, additional_data)
+ if is_previewable:
+ if text.startswith('geo:'):
+ text = _('Location')
+ else:
+ file_name = filename_from_uri(text)
+ _icon, file_type = guess_simple_file_type(text)
+ text = f'{file_type} ({file_name})'
+
if self.is_chat:
msg_type = 'chat-message'
sound = 'first_message_received'
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a0f78d3b3f36b81884b3f5ddef06ebdf…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a0f78d3b3f36b81884b3f5ddef06ebdf…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
48b229b9 by wurstsalat at 2021-11-14T01:49:53+01:00
StatusSelector: Determine show correctly for account
- - - - -
1 changed file:
- gajim/gtk/status_selector.py
Changes:
=====================================
gajim/gtk/status_selector.py
=====================================
@@ -18,6 +18,7 @@
from gajim.common import app
from gajim.common import ged
from gajim.common.const import AvatarSize
+from gajim.common.helpers import get_connection_status
from gajim.common.helpers import get_uf_show
from gajim.common.helpers import get_global_show
from gajim.common.helpers import statuses_unified
@@ -101,16 +102,12 @@ def _on_change_status(self, button):
self._status_popover.popdown()
new_status = button.get_name()
app.interface.change_status(status=new_status, account=self._account)
- self.update()
def update(self, *args, **kwargs):
if self._account is None:
show = get_global_show()
else:
- if self._account not in app.connections:
- return
- client = app.get_client(self._account)
- show = client.status
+ show = get_connection_status(self._account)
surface = get_show_circle(
show, AvatarSize.SHOW_CIRCLE, self.get_scale_factor())
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/48b229b991b0a81db265b7c136bcdbf8…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/48b229b991b0a81db265b7c136bcdbf8…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
8660c9b6 by wurstsalat at 2021-11-11T22:42:32+01:00
Search: Fix missing stanza_id while adding messages
- - - - -
1 changed file:
- gajim/common/storage/archive.py
Changes:
=====================================
gajim/common/storage/archive.py
=====================================
@@ -462,7 +462,7 @@ def get_conversation_around(self, account, jid, timestamp):
sql_before = '''
SELECT contact_name, time, kind, show, message, subject,
- additional_data, log_line_id, message_id,
+ additional_data, log_line_id, message_id, stanza_id,
error as "error [common_error]",
marker as "marker [marker]"
FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8660c9b6da254b26dc0bf88ad7b1c160…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8660c9b6da254b26dc0bf88ad7b1c160…
You're receiving this email because of your account on dev.gajim.org.