Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gajim/gajim
  • lovetox/gajim
  • ag/gajim
  • linkmauve/gajim
  • asterix/gajim
  • andre/gajim
  • mimi89999/gajim
  • bronko/gajim
  • wurstsalat/gajim
  • baitisj/gajim
  • Dicson/gajim
  • PolynomialDivision/gajim
  • troom/gajim
  • sophie-h/gajim
  • marmistrz/gajim
  • mrDoctorWho/gajim
  • orhideous/gajim
  • jjrh/gajim
  • streaps/gajim
  • jhuffine/gajim
  • maltel/gajim
  • Dominion/gajim
  • norstbox/gajim
  • synchrone/gajim
  • mick3247652/gajim
  • Yuki/gajim
  • l-n-s/gajim
  • ehuelsmann/gajim
  • hrxi/gajim
  • SaltyBones/gajim
  • rlgh/gajim
  • genofire/gajim
  • weblate/gajim
  • PapaTutuWawa/gajim
  • eta/gajim
  • jelmer/gajim
  • Ge0rG/gajim
  • TSRh/gajim
  • tolosaeduard/gajim
  • pitchum/gajim
  • mexicarne/gajim
  • prmcgs/gajim
  • mehw/gajim
  • ecxod/gajim
  • wannestas/gajim
  • XutaxKamay/gajim
  • emil/gajim-fork
  • gs/gajim
  • jurajlutter/gajim
  • Sheldon/gajim-cme
  • dexgs/gajim
  • bodqhrohro/gajim
  • Ermine/gajim
  • mesonium/gajim
  • mjk/gajim
  • nicoco/gajim
  • Polarian/gajim
  • izaya/gajim
  • kurion/gajim
  • npmania/gajim
  • ebertus/gajim
  • intelfx/gajim
  • musipusi/gajim
  • wusspuss/gajim
  • slicht/gajim
  • toms/gajim
  • singpolyma/gajim
  • Antiz/gajim
  • hendursaga/gajim
  • cve-1312/gajim
  • smemes2/gajim
  • amlor/gajim
72 results
Show changes
Commits on Source (38)
Showing
with 545 additions and 423 deletions
......@@ -23,6 +23,7 @@ build_script:
- ps: |
$filename = "Gajim-$($env:GAJIM_VERSION)-$($env:ARCH)"
$filename_portable = "Gajim-Portable-$($env:GAJIM_VERSION)-$($env:ARCH)"
$filename_msixbundle = "Gajim-$($env:GAJIM_VERSION)"
if ($env:GAJIM_VERSION -eq "Nightly") {
$time_string=(get-date -UFormat "%Y-%m-%d").ToString()
......@@ -43,6 +44,7 @@ build_script:
Push-AppveyorArtifact "$($buildroot)/Gajim.exe" -FileName "$($filename).exe"
Push-AppveyorArtifact "$($buildroot)/Gajim-Portable.exe" -FileName "$($filename_portable).exe"
Push-AppveyorArtifact "$($buildroot)/Gajim.msixbundle" -FileName "$($filename_msixbundle).msixbundle"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# on_finish:
......
......@@ -398,6 +398,10 @@ class MamMessageReceived(ApplicationEvent):
stanza_id: str
archive_jid: str
kind: KindConstant
occupant_id: str | None
real_jid: JID | None
msg_log_id: int | None
displaymarking: Displaymarking | None
@dataclass
......@@ -423,6 +427,8 @@ class MessageReceived(ApplicationEvent):
class GcMessageReceived(MessageReceived):
name: str = field(init=False, default='gc-message-received')
room_jid: str
real_jid: JID | None
occupant_id: str | None
@dataclass
......
......@@ -806,7 +806,8 @@ class AdditionalDataDict(collections.UserDict):
def get_value(self,
full_path: str,
key: str,
default: str | None = None) -> Any | None:
default: str | bool | None = None
) -> Any | None:
path_childs = self._get_path_childs(full_path)
_dict = self.data
......
......@@ -971,6 +971,10 @@ class GroupchatParticipant(CommonContact):
def type_string(self) -> str:
return 'pm'
@property
def occupant_id(self) -> str | None:
return self._presence.occupant_id
def can_add_to_roster(
contact: BareContact | GroupchatContact | GroupchatParticipant
......
......@@ -241,6 +241,10 @@ class Discovery(BaseModule):
account=self._account,
jid=result.info.jid))
contact = self._con.get_module('Contacts').get_contact(
result.info.jid, groupchat=True)
contact.notify('disco-info-update')
yield result
@as_task
......
......@@ -299,6 +299,13 @@ class MAM(BaseModule):
return
stanza_id = message_id
occupant_id = self._get_occupant_id(properties)
real_jid = self._get_real_jid(properties)
displaymarking = None
if properties.has_security_label:
displaymarking = properties.security_label.displaymarking
event_attr: dict[str, Any] = {
'account': self._account,
'jid': jid,
......@@ -309,6 +316,9 @@ class MAM(BaseModule):
'stanza_id': stanza_id,
'archive_jid': properties.mam.archive,
'kind': kind,
'occupant_id': occupant_id,
'real_jid': real_jid,
'displaymarking': displaymarking
}
if check_if_message_correction(properties,
......@@ -320,7 +330,7 @@ class MAM(BaseModule):
self._log):
return
app.storage.archive.insert_into_logs(
event_attr['msg_log_id'] = app.storage.archive.insert_into_logs(
self._account,
jid,
properties.mam.timestamp,
......@@ -329,10 +339,35 @@ class MAM(BaseModule):
contact_name=properties.muc_nickname,
additional_data=additional_data,
stanza_id=stanza_id,
message_id=properties.id)
message_id=properties.id,
occupant_id=occupant_id,
real_jid=real_jid,
)
app.ged.raise_event(MamMessageReceived(**event_attr))
def _get_real_jid(self, properties: MessageProperties) -> JID | None:
if not properties.type.is_groupchat:
return None
if properties.muc_user is None:
return None
return properties.muc_user.jid
def _get_occupant_id(self, properties: MessageProperties) -> str | None:
if not properties.type.is_groupchat:
return None
if properties.occupant_id is None:
return None
contact = self._client.get_module('Contacts').get_contact(
properties.jid.bare, groupchat=True)
if contact.supports(Namespace.OCCUPANT_ID):
return properties.occupant_id
return None
def _is_valid_request(self, properties: MessageProperties) -> bool:
valid_id = self._mam_query_ids.get(properties.mam.archive, None)
return valid_id == properties.mam.query_id
......
......@@ -22,6 +22,7 @@ import time
import nbxmpp
from nbxmpp.namespaces import Namespace
from nbxmpp.protocol import JID
from nbxmpp.structs import MessageProperties
from nbxmpp.structs import StanzaHandler
from nbxmpp.util import generate_id
......@@ -35,6 +36,7 @@ from gajim.common.events import MessageReceived
from gajim.common.events import RawMessageReceived
from gajim.common.helpers import AdditionalDataDict
from gajim.common.modules.base import BaseModule
from gajim.common.modules.contacts import GroupchatParticipant
from gajim.common.modules.misc import parse_oob
from gajim.common.modules.misc import parse_xhtml
from gajim.common.modules.util import check_if_message_correction
......@@ -192,13 +194,23 @@ class Message(BaseModule):
if not msgtxt:
return
occupant_id = None
group_contact = self._client.get_module('Contacts').get_contact(
jid, groupchat=True)
if group_contact.supports(Namespace.OCCUPANT_ID):
# Only store occupant-id if MUC announces support
occupant_id = properties.occupant_id
real_jid = self._get_real_jid(properties)
event_attr.update({
'room_jid': jid,
'real_jid': real_jid,
'occupant_id': occupant_id,
})
event = GcMessageReceived(**event_attr)
# TODO: Some plugins modify msgtxt in the GUI event
msg_log_id = self._log_muc_message(event)
event.msg_log_id = msg_log_id
app.ged.raise_event(event)
......@@ -248,28 +260,44 @@ class Message(BaseModule):
error=properties.error))
def _log_muc_message(self, event: GcMessageReceived) -> int | None:
if not event.properties.muc_nickname:
return None
if not event.msgtxt:
return None
self._check_for_mam_compliance(event.room_jid, event.stanza_id)
if event.msgtxt and event.properties.muc_nickname:
msg_log_id = app.storage.archive.insert_into_logs(
self._account,
event.jid,
event.properties.timestamp,
KindConstant.GC_MSG,
message=event.msgtxt,
contact_name=event.properties.muc_nickname,
additional_data=event.additional_data,
stanza_id=event.stanza_id,
message_id=event.properties.id)
return msg_log_id
return None
return app.storage.archive.insert_into_logs(
self._account,
event.jid,
event.properties.timestamp,
KindConstant.GC_MSG,
message=event.msgtxt,
contact_name=event.properties.muc_nickname,
additional_data=event.additional_data,
stanza_id=event.stanza_id,
message_id=event.properties.id,
occupant_id=event.occupant_id,
real_Jid=event.real_jid)
def _check_for_mam_compliance(self, room_jid: str, stanza_id: str) -> None:
disco_info = app.storage.cache.get_last_disco_info(room_jid)
if stanza_id is None and disco_info.mam_namespace == Namespace.MAM_2:
self._log.warning('%s announces mam:2 without stanza-id', room_jid)
def _get_real_jid(self, properties: MessageProperties) -> JID | None:
if not properties.type.is_groupchat:
return None
if not properties.jid.is_full:
return None
participant = self._client.get_module('Contacts').get_contact(
properties.jid, groupchat=True)
assert isinstance(participant, GroupchatParticipant)
return participant.real_jid
def _get_unique_id(self,
properties: MessageProperties
) -> tuple[str | None, str | None]:
......
......@@ -759,8 +759,15 @@ class MUC(BaseModule):
def _process_user_presence(self,
properties: PresenceProperties
) -> MUCPresenceData:
jid = properties.jid
muc_presence = MUCPresenceData.from_presence(properties)
group_contact = self._client.get_module('Contacts').get_contact(
jid.bare, groupchat=True)
occupant_id = None
if group_contact.supports(Namespace.OCCUPANT_ID):
occupant_id = properties.occupant_id
muc_presence = MUCPresenceData.from_presence(properties, occupant_id)
if not muc_presence.available:
self._joined_users[jid.bare].pop(jid.resource)
else:
......
......@@ -159,7 +159,7 @@ class Preview:
return self._request
@property
def request_uri(self) -> str | None:
def request_uri(self) -> str:
if self._urlparts is None:
return ''
if self.is_aes_encrypted:
......@@ -306,7 +306,12 @@ class PreviewManager:
def is_previewable(self,
text: str,
additional_data: AdditionalDataDict) -> bool:
additional_data: AdditionalDataDict | None
) -> bool:
if additional_data is None:
return False
if not IRI_RX.fullmatch(text):
# urlparse removes whitespace (and who knows what else) from URLs,
# so can't be used for validation.
......@@ -336,6 +341,7 @@ class PreviewManager:
from_us: bool,
context: str | None = None
) -> None:
if uri.startswith('geo:'):
preview = Preview(uri, None, None, None, 96, widget)
preview.update_widget()
......@@ -345,6 +351,10 @@ class PreviewManager:
preview = self._process_web_uri(uri, widget, from_us, context)
self._previews[preview.id] = preview
if not app.settings.get('enable_file_preview'):
preview.update_widget()
return
if not preview.orig_exists:
if context is not None and not from_us:
allow_in_public = app.settings.get('preview_anonymous_muc')
......@@ -355,11 +365,13 @@ class PreviewManager:
self.download_content(preview)
elif not preview.thumb_exists:
assert preview.orig_path is not None
load_file_async(preview.orig_path,
self._on_orig_load_finished,
preview)
else:
assert preview.thumb_path is not None
load_file_async(preview.thumb_path,
self._on_thumb_load_finished,
preview)
......@@ -401,6 +413,7 @@ class PreviewManager:
preview.file_size = os.path.getsize(preview.orig_path)
if preview.is_previewable:
if preview.create_thumbnail(data):
assert preview.thumbnail is not None
write_file_async(preview.thumb_path,
preview.thumbnail,
self._on_thumb_write_finished,
......@@ -555,8 +568,13 @@ class PreviewManager:
self._on_orig_write_finished,
preview)
if not app.settings.get('enable_file_preview'):
preview.update_widget()
return
if preview.is_previewable:
if preview.create_thumbnail(data):
assert preview.thumb_path is not None
write_file_async(preview.thumb_path,
preview.thumbnail,
self._on_thumb_write_finished,
......@@ -566,7 +584,7 @@ class PreviewManager:
@staticmethod
def _on_orig_write_finished(_result: bool,
error: GLib.Error,
error: GLib.Error | None,
preview: Preview) -> None:
if preview.orig_path is None:
return
......@@ -584,7 +602,7 @@ class PreviewManager:
@staticmethod
def _on_thumb_write_finished(_result: bool,
error: GLib.Error,
error: GLib.Error | None,
preview: Preview) -> None:
if preview.thumb_path is None:
return
......
......@@ -99,17 +99,17 @@ class JidsTableRow(NamedTuple):
class ConversationRow(NamedTuple):
log_line_id: int
contact_name: str | None
occupant_id: str | None
real_jid: JID | None
time: float
kind: int
show: int
message: str
subject: str
error: CommonError
additional_data: AdditionalDataDict | None
log_line_id: int
message_id: str
stanza_id: str
error: CommonError
message_id: str
marker: str
......@@ -382,10 +382,19 @@ class MessageArchiveStorage(SqliteStorage):
time_order = 'AND time > ? ORDER BY time ASC, log_line_id ASC'
sql = '''
SELECT contact_name, time, kind, show, message, subject,
additional_data, log_line_id, message_id, stanza_id,
error as "error [common_error]",
marker as "marker [marker]"
SELECT
log_line_id,
contact_name,
occupant_id,
real_jid as "real_jid [jid]",
time,
kind,
message,
error as "error [common_error]",
additional_data,
stanza_id,
message_id,
marker as "marker [marker]"
FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
AND account_id = {account_id}
AND kind NOT IN ({kinds})
......@@ -459,10 +468,19 @@ class MessageArchiveStorage(SqliteStorage):
n_lines = 50
sql_before = '''
SELECT contact_name, time, kind, show, message, subject,
additional_data, log_line_id, message_id, stanza_id,
error as "error [common_error]",
marker as "marker [marker]"
SELECT
log_line_id,
contact_name,
occupant_id,
real_jid as "real_jid [jid]",
time,
kind,
message,
error as "error [common_error]",
additional_data,
stanza_id,
message_id,
marker as "marker [marker]"
FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
AND account_id = {account_id}
AND kind NOT IN ({kinds})
......@@ -473,10 +491,19 @@ class MessageArchiveStorage(SqliteStorage):
account_id=account_id,
kinds=', '.join(kinds))
sql_at_after = '''
SELECT contact_name, time, kind, show, message, subject,
additional_data, log_line_id, message_id, stanza_id,
error as "error [common_error]",
marker as "marker [marker]"
SELECT
log_line_id,
contact_name,
occupant_id,
real_jid as "real_jid [jid]",
time,
kind,
message,
error as "error [common_error]",
additional_data,
stanza_id,
message_id,
marker as "marker [marker]"
FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
AND account_id = {account_id}
AND kind NOT IN ({kinds})
......@@ -518,10 +545,19 @@ class MessageArchiveStorage(SqliteStorage):
kinds = map(str, [KindConstant.ERROR])
sql = '''
SELECT contact_name, time, kind, show, message, subject,
additional_data, log_line_id, message_id, stanza_id,
error as "error [common_error]",
marker as "marker [marker]"
SELECT
log_line_id,
contact_name,
occupant_id,
real_jid as "real_jid [jid]",
time,
kind,
message,
error as "error [common_error]",
additional_data,
stanza_id,
message_id,
marker as "marker [marker]"
FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
AND account_id = {account_id}
AND kind NOT IN ({kinds})
......
......@@ -237,16 +237,22 @@ class MUCPresenceData:
affiliation: Affiliation
role: Role
real_jid: JID | None
occupant_id: str | None
@classmethod
def from_presence(cls, properties: PresenceProperties) -> MUCPresenceData:
def from_presence(cls,
properties: PresenceProperties,
occupant_id: str | None
) -> MUCPresenceData:
return cls(show=properties.show,
status=properties.status,
idle_time=properties.idle_timestamp,
available=properties.type.is_available,
affiliation=properties.muc_user.affiliation,
role=properties.muc_user.role,
real_jid=properties.muc_user.jid)
real_jid=properties.muc_user.jid,
occupant_id=occupant_id)
UNKNOWN_MUC_PRESENCE = MUCPresenceData(show=PresenceShowExt.OFFLINE,
......@@ -255,7 +261,8 @@ UNKNOWN_MUC_PRESENCE = MUCPresenceData(show=PresenceShowExt.OFFLINE,
available=False,
affiliation=Affiliation.NONE,
role=Role.NONE,
real_jid=None)
real_jid=None,
occupant_id=None)
class VariantMixin:
......
......@@ -38,7 +38,7 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=5 -->
<!-- n-columns=2 n-rows=9 -->
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can-focus">False</property>
......@@ -85,7 +85,6 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<signal name="changed" handler="_on_name_entry_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
......@@ -159,7 +158,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="advanced_switch_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
......@@ -172,147 +171,153 @@
</packing>
</child>
<child>
<object class="GtkBox" id="advanced_box">
<object class="GtkLabel" id="error_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="wrap">True</property>
<property name="max-width-chars">38</property>
<style>
<class name="error-color"/>
<class name="padding-12"/>
</style>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="info_label">
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="halign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="wrap">True</property>
<property name="max-width-chars">38</property>
<style>
<class name="padding-12"/>
</style>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="address_entry_label">
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="halign">end</property>
<property name="margin-top">12</property>
<property name="label" translatable="yes">_Address</property>
<property name="use-underline">True</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="address_entry">
<property name="width-request">250</property>
<property name="can-focus">True</property>
<property name="no-show-all">True</property>
<property name="margin-top">12</property>
<signal name="changed" handler="_on_address_entry_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="public_radio">
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="no-show-all">True</property>
<property name="margin-top">12</property>
<property name="draw-indicator">True</property>
<property name="group">private_radio</property>
<child>
<object class="GtkRadioButton" id="private_radio">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="margin-top">12</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<property name="group">public_radio</property>
<property name="can-focus">False</property>
<property name="margin-start">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="margin-start">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Private</property>
<property name="use-markup">True</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="bold"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">You have to invite people so they can join</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="label" translatable="yes">Public</property>
<property name="use-markup">True</property>
<property name="xalign">0</property>
<style>
<class name="bold"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="public_radio">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<property name="group">private_radio</property>
<child>
<object class="GtkBox">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Public</property>
<property name="use-markup">True</property>
<property name="xalign">0</property>
<style>
<class name="bold"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Anyone can join</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="halign">start</property>
<property name="label" translatable="yes">Anyone can join</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="private_radio">
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="no-show-all">True</property>
<property name="margin-top">12</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="spacing">12</property>
<property name="halign">start</property>
<property name="margin-start">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">_Address</property>
<property name="use-underline">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Private</property>
<property name="use-markup">True</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
<class name="bold"/>
</style>
</object>
<packing>
......@@ -322,11 +327,16 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="address_entry">
<property name="width-request">250</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="changed" handler="_on_address_entry_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">You have to invite people so they can join</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
......@@ -335,19 +345,19 @@
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -33,7 +33,7 @@ from gajim.common import types
from gajim.common.const import ClientState
from gajim.common.i18n import _
from gajim.common.i18n import p_
from gajim.common.settings import AllSettingsT
from gajim.common.setting_values import AllSettingsT
from gajim.gtk.const import Setting
from gajim.gtk.const import SettingKind
......
......@@ -402,10 +402,13 @@ class GroupchatCreationBuilder(Builder):
account_combo: Gtk.ComboBox
account_label: Gtk.Label
advanced_switch: Gtk.Switch
advanced_box: Gtk.Box
private_radio: Gtk.RadioButton
public_radio: Gtk.RadioButton
advanced_switch_label: Gtk.Label
error_label: Gtk.Label
info_label: Gtk.Label
address_entry_label: Gtk.Label
address_entry: Gtk.Entry
public_radio: Gtk.RadioButton
private_radio: Gtk.RadioButton
spinner: Gtk.Spinner
create_button: Gtk.Button
......
......@@ -30,7 +30,6 @@ from gajim.common.const import XmppUriQuery
from gajim.common.events import AccountEnabled
from gajim.common.events import BookmarksReceived
from gajim.common.events import MessageReceived
from gajim.common.events import MucDiscoUpdate
from gajim.common.ged import EventHelper
from gajim.common.helpers import generate_qr_code
from gajim.common.i18n import _
......@@ -91,7 +90,6 @@ class ChatBanner(Gtk.Box, EventHelper):
if not self.has_events_registered():
self.register_events([
('message-received', ged.GUI2, self._on_message_received),
('muc-disco-update', ged.GUI2, self._on_muc_disco_update),
('bookmarks-received', ged.GUI2, self._on_bookmarks_received),
('account-enabled', ged.GUI2, self._on_account_changed),
('account-disabled', ged.GUI2, self._on_account_changed)
......@@ -125,7 +123,8 @@ class ChatBanner(Gtk.Box, EventHelper):
self._contact.multi_connect({
'user-role-changed': self._on_user_role_changed,
'state-changed': self._on_muc_state_changed,
'room-voice-request': self._on_room_voice_request
'room-voice-request': self._on_room_voice_request,
'disco-info-update': self._on_disco_info_update,
})
elif isinstance(self._contact, GroupchatParticipant):
......@@ -215,10 +214,10 @@ class ChatBanner(Gtk.Box, EventHelper):
self._update_name_label()
def _on_muc_disco_update(self, event: MucDiscoUpdate) -> None:
assert self._contact is not None
if event.jid != self._contact.jid:
return
def _on_disco_info_update(self,
_contact: GroupchatContact,
_signal_name: str
) -> None:
self._update_name_label()
self._update_description_label()
......
......@@ -522,6 +522,8 @@ class ChatListRow(Gtk.ListBoxRow):
elif isinstance(self.contact, GroupchatContact):
self.contact.connect('avatar-update', self._on_avatar_update)
self.contact.connect('disco-info-update',
self._on_disco_info_update)
self.contact.connect('state-changed', self._on_muc_state_changed)
self.contact.connect('mam-sync-started', self._on_mam_sync_changed)
self.contact.connect('mam-sync-finished', self._on_mam_sync_changed)
......@@ -557,6 +559,12 @@ class ChatListRow(Gtk.ListBoxRow):
) -> None:
self.update_avatar()
def _on_disco_info_update(self,
_contact: ChatContactT,
_signal_name: str
) -> None:
self.update_name()
def _on_client_state_changed(self, *args: Any) -> None:
self._update_joined_state()
......
......@@ -31,7 +31,7 @@ from gajim.common.i18n import _
from gajim.gtk import structs
from gajim.gtk.chat_filter import ChatFilter
from gajim.gtk.chat_list import ChatList
from gajim.gtk.chat_list import ChatListRow
from gajim.gtk.chat_list_row import ChatListRow
from gajim.gtk.dialogs import ConfirmationCheckDialog
from gajim.gtk.dialogs import DialogButton
......
This diff is collapsed.
......@@ -21,9 +21,9 @@ from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import Pango
from gajim.common.const import URIType
from gajim.common.helpers import open_uri
from gajim.common.helpers import parse_uri
from gajim.common.structs import URIType
from gajim.common.styling import BaseHyperlink
from gajim.common.styling import PlainBlock
from gajim.common.styling import process_uris
......
......@@ -106,13 +106,7 @@ class MessageRow(BaseRow):
else:
from_us = kind == 'outgoing'
is_previewable = False
preview_enabled = app.settings.get('enable_file_preview')
if additional_data is not None and preview_enabled:
is_previewable = app.preview_manager.is_previewable(
text, additional_data)
if is_previewable:
if app.preview_manager.is_previewable(text, additional_data):
muc_context = None
if isinstance(self._contact,
GroupchatContact | GroupchatParticipant):
......