Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
195
Issues
195
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
227cdb74
Commit
227cdb74
authored
Sep 30, 2006
by
sb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proper handling of normal accounts with the name 'Local',
don't use account's name but is_zeroconf flag for checks
parent
6ec6ec43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
19 deletions
+25
-19
src/common/zeroconf/connection_zeroconf.py
src/common/zeroconf/connection_zeroconf.py
+2
-6
src/common/zeroconf/zeroconf.py
src/common/zeroconf/zeroconf.py
+5
-6
src/config.py
src/config.py
+14
-3
src/gajim.py
src/gajim.py
+1
-1
src/roster_window.py
src/roster_window.py
+3
-3
No files found.
src/common/zeroconf/connection_zeroconf.py
View file @
227cdb74
...
...
@@ -140,13 +140,9 @@ def get_config_values_or_default(self):
self
.
email
=
gajim
.
config
.
get_per
(
'accounts'
,
gajim
.
ZEROCONF_ACC_NAME
,
'zeroconf_email'
)
# END __init__
def
put_event
(
self
,
ev
):
if
gajim
.
handlers
.
has_key
(
ev
[
0
]):
gajim
.
handlers
[
ev
[
0
]](
self
.
name
,
ev
[
1
])
def
dispatch
(
self
,
event
,
data
):
'''always passes account name as first param'''
self
.
put_event
((
event
,
data
)
)
if
gajim
.
handlers
.
has_key
(
event
):
gajim
.
handlers
[
event
](
self
.
name
,
data
)
def
_reconnect
(
self
):
gajim
.
log
.
debug
(
'reconnect'
)
...
...
src/common/zeroconf/zeroconf.py
View file @
227cdb74
...
...
@@ -74,18 +74,18 @@ def error_callback(self, err):
def
new_service_callback
(
self
,
interface
,
protocol
,
name
,
stype
,
domain
,
flags
):
gajim
.
log
.
debug
(
'Found service %s in domain %s on %i.%i.'
%
(
name
,
domain
,
interface
,
protocol
))
if
not
self
.
connected
:
return
#
if not self.connected:
#
return
#synchronous resolving
#
synchronous resolving
self
.
server
.
ResolveService
(
int
(
interface
),
int
(
protocol
),
name
,
stype
,
\
domain
,
avahi
.
PROTO_UNSPEC
,
dbus
.
UInt32
(
0
),
\
reply_handler
=
self
.
service_resolved_callback
,
error_handler
=
self
.
error_callback
)
def
remove_service_callback
(
self
,
interface
,
protocol
,
name
,
stype
,
domain
,
flags
):
gajim
.
log
.
debug
(
'Service %s in domain %s on %i.%i disappeared.'
%
(
name
,
domain
,
interface
,
protocol
))
#if not self.connected:
# return
#
if not self.connected:
#
return
if
name
!=
self
.
name
:
for
key
in
self
.
contacts
.
keys
():
if
self
.
contacts
[
key
][
C_BARE_NAME
]
==
name
:
...
...
@@ -98,7 +98,6 @@ def new_service_type(self, interface, protocol, stype, domain, flags):
if
self
.
service_browser
:
return
object_path
=
self
.
server
.
ServiceBrowserNew
(
interface
,
protocol
,
\
stype
,
domain
,
dbus
.
UInt32
(
0
))
...
...
src/config.py
View file @
227cdb74
...
...
@@ -1357,6 +1357,9 @@ def on_save_button_clicked(self, widget):
config
[
'custom_host'
]
=
self
.
xml
.
get_widget
(
'custom_host_entry'
).
get_text
().
decode
(
'utf-8'
)
# update in case the name changed to local accounts name
config
[
'is_zeroconf'
]
=
False
config
[
'keyname'
]
=
self
.
xml
.
get_widget
(
'gpg_name_label'
).
get_text
().
decode
(
'utf-8'
)
if
config
[
'keyname'
]
==
''
:
#no key selected
config
[
'keyid'
]
=
''
...
...
@@ -1804,7 +1807,7 @@ def __init__(self):
w
.
set_active
(
st
)
if
os
.
name
==
'nt'
or
(
avahi_error
and
not
w
.
get_active
()):
w
.
set_sensitive
(
False
)
w
.
connect
(
'toggled'
,
self
.
on_enable_zeroconf_checkbutton_toggled
)
self
.
zeroconf_toggled_id
=
w
.
connect
(
'toggled'
,
self
.
on_enable_zeroconf_checkbutton_toggled
)
def
on_accounts_window_key_press_event
(
self
,
widget
,
event
):
if
event
.
keyval
==
gtk
.
keysyms
.
Escape
:
...
...
@@ -1845,7 +1848,7 @@ def on_remove_button_clicked(self, widget):
dialogs
.
ErrorDialog
(
_
(
'Unread events'
),
_
(
'Read all pending events before removing this account.'
))
return
if
account
==
gajim
.
ZEROCONF_ACC_NAME
:
if
gajim
.
config
.
get_per
(
'accounts'
,
account
,
'is_zeroconf'
)
:
w
=
self
.
xml
.
get_widget
(
'enable_zeroconf_checkbutton'
)
w
.
set_active
(
False
)
else
:
...
...
@@ -1871,7 +1874,7 @@ def on_accounts_treeview_row_activated(self, widget, path, column):
self
.
show_modification_window
(
account
)
def
show_modification_window
(
self
,
account
):
if
account
==
gajim
.
ZEROCONF_ACC_NAME
:
if
gajim
.
config
.
get_per
(
'accounts'
,
account
,
'is_zeroconf'
)
:
if
gajim
.
interface
.
instances
.
has_key
(
'zeroconf_properties'
):
gajim
.
interface
.
instances
[
'zeroconf_properties'
].
window
.
present
()
else
:
...
...
@@ -1902,6 +1905,14 @@ def on_merge_checkbutton_toggled(self, widget):
def
on_enable_zeroconf_checkbutton_toggled
(
self
,
widget
):
# don't do anything if there is an account with the local name but is a normal account
if
gajim
.
connections
.
has_key
(
gajim
.
ZEROCONF_ACC_NAME
)
and
not
gajim
.
connections
[
gajim
.
ZEROCONF_ACC_NAME
].
is_zeroconf
:
gajim
.
connections
[
gajim
.
ZEROCONF_ACC_NAME
].
dispatch
(
'ERROR'
,
(
_
(
'Account Local already exists.'
),
_
(
'Please rename or remove it before enabling link-local messaging.'
)))
widget
.
disconnect
(
self
.
zeroconf_toggled_id
)
widget
.
set_active
(
False
)
self
.
zeroconf_toggled_id
=
widget
.
connect
(
'toggled'
,
self
.
on_enable_zeroconf_checkbutton_toggled
)
return
if
gajim
.
config
.
get
(
'enable_zeroconf'
):
#disable
gajim
.
interface
.
roster
.
close_all
(
gajim
.
ZEROCONF_ACC_NAME
)
...
...
src/gajim.py
View file @
227cdb74
...
...
@@ -1888,7 +1888,7 @@ def __init__(self):
if
gajim
.
config
.
get
(
'enable_zeroconf'
):
gajim
.
connections
[
gajim
.
ZEROCONF_ACC_NAME
]
=
common
.
zeroconf
.
connection_zeroconf
.
ConnectionZeroconf
(
gajim
.
ZEROCONF_ACC_NAME
)
for
account
in
gajim
.
config
.
get_per
(
'accounts'
):
if
account
!=
gajim
.
ZEROCONF_ACC_NAME
:
if
not
gajim
.
config
.
get_per
(
'accounts'
,
account
,
'is_zeroconf'
)
:
gajim
.
connections
[
account
]
=
common
.
connection
.
Connection
(
account
)
# gtk hooks
...
...
src/roster_window.py
View file @
227cdb74
...
...
@@ -1369,7 +1369,7 @@ def make_contact_menu(self, event, iter):
if
not
contact
:
return
if
account
==
gajim
.
ZEROCONF_ACC_NAME
:
if
gajim
.
config
.
get_per
(
'accounts'
,
account
,
'is_zeroconf'
)
:
xml
=
gtkgui_helpers
.
get_glade
(
'zeroconf_contact_context_menu.glade'
)
zeroconf_contact_context_menu
=
xml
.
get_widget
(
'zeroconf_contact_context_menu'
)
...
...
@@ -3730,7 +3730,7 @@ def drag_data_received_data(self, treeview, context, x, y, selection, info,
account_dest
,
c_dest
,
path
)
return
if
account_dest
==
gajim
.
ZEROCONF_ACC_NAME
:
if
gajim
.
config
.
get_per
(
'accounts'
,
account_dest
,
'is_zeroconf'
)
:
# drop on zeroconf account, no contact adds possible
return
...
...
@@ -3745,7 +3745,7 @@ def drag_data_received_data(self, treeview, context, x, y, selection, info,
return
if
type_dest
==
'account'
and
account_source
==
account_dest
:
return
if
account_source
==
gajim
.
ZEROCONF_ACC_NAME
:
if
gajim
.
config
.
get_per
(
'accounts'
,
account_source
,
'is_zeroconf'
)
:
return
it
=
iter_source
while
model
[
it
][
C_TYPE
]
==
'contact'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment