Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
dd3bbf2b
Commit
dd3bbf2b
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Request security catalog from the barejid
- Some Code/UI cleanup
parent
944a1a93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/chat_control_base.py
+9
-11
9 additions, 11 deletions
gajim/chat_control_base.py
gajim/common/modules/security_labels.py
+3
-4
3 additions, 4 deletions
gajim/common/modules/security_labels.py
gajim/data/gui/chat_control.ui
+58
-59
58 additions, 59 deletions
gajim/data/gui/chat_control.ui
with
70 additions
and
74 deletions
gajim/chat_control_base.py
+
9
−
11
View file @
dd3bbf2b
...
...
@@ -185,19 +185,18 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
def
_sec_labels_received
(
self
,
event
):
if
event
.
account
!=
self
.
account
:
return
jid
=
nbxmpp
.
JID
(
self
.
contact
.
jid
)
if
event
.
host
!=
jid
.
getDomain
():
if
event
.
jid
!=
self
.
contact
.
jid
:
return
l
b
=
self
.
seclabel_combo
.
get_model
()
l
b
.
clear
()
i
=
0
mode
l
=
self
.
seclabel_combo
.
get_model
()
mode
l
.
clear
()
sel
=
0
_label
,
labellist
,
default
=
event
.
catalog
for
label
in
labellist
:
l
b
.
append
([
label
])
for
index
,
label
in
enumerate
(
labellist
)
:
mode
l
.
append
([
label
])
if
label
==
default
:
sel
=
i
i
+=
1
sel
=
i
ndex
self
.
seclabel_combo
.
set_active
(
sel
)
self
.
seclabel_combo
.
set_no_show_all
(
False
)
self
.
seclabel_combo
.
show_all
()
...
...
@@ -773,8 +772,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
return
con
=
app
.
connections
[
self
.
account
]
jid
=
nbxmpp
.
JID
(
self
.
contact
.
jid
)
catalog
=
con
.
get_module
(
'
SecLabels
'
).
get_catalog
(
jid
.
getDomain
())
catalog
=
con
.
get_module
(
'
SecLabels
'
).
get_catalog
(
self
.
contact
.
jid
)
labels
,
label_list
,
_
=
catalog
lname
=
label_list
[
idx
]
label
=
labels
[
lname
]
...
...
This diff is collapsed.
Click to expand it.
gajim/common/modules/security_labels.py
+
3
−
4
View file @
dd3bbf2b
...
...
@@ -42,12 +42,11 @@ class SecLabels:
log
.
info
(
'
Discovered security labels: %s
'
,
from_
)
def
request_catalog
(
self
,
jid
):
jid
=
nbxmpp
.
JID
(
jid
)
server
=
app
.
get_jid_from_account
(
self
.
_account
).
split
(
"
@
"
)[
1
]
iq
=
nbxmpp
.
Iq
(
typ
=
'
get
'
,
to
=
server
)
iq
.
addChild
(
name
=
'
catalog
'
,
namespace
=
nbxmpp
.
NS_SECLABEL_CATALOG
,
attrs
=
{
'
to
'
:
jid
.
getDomain
()
})
attrs
=
{
'
to
'
:
jid
})
log
.
info
(
'
Request catalog: server: %s, to: %s
'
,
server
,
jid
)
self
.
_con
.
connection
.
SendAndCallForResponse
(
iq
,
self
.
_catalog_received
)
...
...
@@ -74,11 +73,11 @@ class SecLabels:
catalog
=
(
labels
,
label_list
,
default
)
self
.
_catalogs
[
to
]
=
catalog
log
.
info
(
'
Received catalog
from
%s
'
,
stanza
.
getFrom
()
)
log
.
info
(
'
Received catalog
:
%s
'
,
to
)
log
.
debug
(
catalog
)
app
.
nec
.
push_incoming_event
(
SecLabelCatalog
(
None
,
account
=
self
.
_account
,
host
=
to
,
catalog
=
catalog
))
None
,
account
=
self
.
_account
,
jid
=
to
,
catalog
=
catalog
))
def
get_catalog
(
self
,
jid
):
return
self
.
_catalogs
.
get
(
jid
)
...
...
This diff is collapsed.
Click to expand it.
gajim/data/gui/chat_control.ui
+
58
−
59
View file @
dd3bbf2b
...
...
@@ -634,17 +634,57 @@
<property
name=
"can_focus"
>
False
</property>
<property
name=
"events"
>
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
</property>
<child>
<object
class=
"Gtk
ComboBox"
id=
"label_selec
to
r
"
>
<object
class=
"Gtk
MenuButton"
id=
"emoticons_but
to
n
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"tooltip_text"
translatable=
"yes"
>
Show a list of emoticons (Alt+M)
</property>
<property
name=
"relief"
>
none
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"icon_name"
>
face-smile-symbolic
</property>
</object>
</child>
<style>
<class
name=
"chatcontrol-actionbar-button"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkMenuButton"
id=
"formattings_button"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"focus_on_click"
>
False
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"events"
>
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
</property>
<property
name=
"has_tooltip"
>
True
</property>
<property
name=
"relief"
>
none
</property>
<property
name=
"popup"
>
formattings_menu
</property>
<child>
<object
class=
"GtkImage"
id=
"image10"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"icon_name"
>
format-text-bold-symbolic
</property>
<property
name=
"icon_size"
>
1
</property>
</object>
</child>
<style>
<class
name=
"chatcontrol-actionbar-button"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkBox"
id=
"audio_buttons_hbox"
>
<property
name=
"can_focus"
>
False
</property>
...
...
@@ -746,7 +786,18 @@ audio-mic-volume-low</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
1
</property>
<property
name=
"position"
>
2
</property>
</packing>
</child>
<child>
<object
class=
"GtkComboBox"
id=
"label_selector"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
<child>
...
...
@@ -770,7 +821,7 @@ audio-mic-volume-low</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
2
</property>
<property
name=
"position"
>
4
</property>
</packing>
</child>
<child>
...
...
@@ -797,7 +848,7 @@ audio-mic-volume-low</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
3
</property>
<property
name=
"position"
>
5
</property>
</packing>
</child>
<child>
...
...
@@ -818,7 +869,7 @@ audio-mic-volume-low</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
4
</property>
<property
name=
"position"
>
6
</property>
</packing>
</child>
<child>
...
...
@@ -845,58 +896,6 @@ audio-mic-volume-low</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
False
</property>
<property
name=
"pack_type"
>
end
</property>
<property
name=
"position"
>
5
</property>
</packing>
</child>
<child>
<object
class=
"GtkMenuButton"
id=
"emoticons_button"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"tooltip_text"
translatable=
"yes"
>
Show a list of emoticons (Alt+M)
</property>
<property
name=
"relief"
>
none
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"icon_name"
>
face-smile-symbolic
</property>
</object>
</child>
<style>
<class
name=
"chatcontrol-actionbar-button"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
6
</property>
</packing>
</child>
<child>
<object
class=
"GtkMenuButton"
id=
"formattings_button"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"focus_on_click"
>
False
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"events"
>
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
</property>
<property
name=
"has_tooltip"
>
True
</property>
<property
name=
"relief"
>
none
</property>
<property
name=
"popup"
>
formattings_menu
</property>
<child>
<object
class=
"GtkImage"
id=
"image10"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"icon_name"
>
format-text-bold-symbolic
</property>
<property
name=
"icon_size"
>
1
</property>
</object>
</child>
<style>
<class
name=
"chatcontrol-actionbar-button"
/>
</style>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
7
</property>
</packing>
</child>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment