Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Malte L
gajim-plugins
Commits
4da67cdf
Commit
4da67cdf
authored
Nov 01, 2018
by
Daniel Brötzmann
Committed by
Philipp Hörist
Nov 07, 2018
Browse files
[hamster_integration] Fix imports, fix Activity sending and retracting
parent
0faa4163
Changes
1
Hide whitespace changes
Inline
Side-by-side
hamster/hamster.py
View file @
4da67cdf
...
...
@@ -10,13 +10,9 @@ from gajim.common import dbus_support
from
gajim.plugins
import
GajimPlugin
from
gajim.plugins.helpers
import
log_calls
from
gajim.common.pep
import
ACTIVITIES
from
gajim.plugins.plugins_i18n
import
_
from
gajim.common.const
import
ACTIVITIES
# Since Gajim 1.1.0 _() has to be imported
try
:
from
gajim.common.i18n
import
_
except
ImportError
:
pass
HAMSTAER_INTERFACE
=
'org.gnome.Hamster'
SUBACTIVITIES
=
[]
...
...
@@ -31,9 +27,8 @@ class HamsterIntegrationPlugin(GajimPlugin):
@
log_calls
(
'HamsterIntegrationPlugin'
)
def
init
(
self
):
self
.
description
=
_
(
'Integration with project hamster
\n
'
'see https://trac.gajim.org/ticket/6993
\n
'
'and http://projecthamster.wordpress.com/about/'
)
self
.
description
=
_
(
'Integration with project hamster, see '
'http://projecthamster.wordpress.com/about/'
)
self
.
config_dialog
=
None
self
.
events_handlers
=
{}
if
os
.
name
==
'nt'
:
...
...
@@ -79,7 +74,7 @@ class HamsterIntegrationPlugin(GajimPlugin):
for
account
in
accounts
:
if
app
.
account_is_connected
(
account
):
connection
=
app
.
connections
[
account
]
connection
.
r
et
ract_activity
(
)
connection
.
g
et
_module
(
'UserActivity'
).
send
(
None
)
return
last_fact
=
self
.
from_dbus_fact
(
facts
[
-
1
])
...
...
@@ -98,8 +93,8 @@ class HamsterIntegrationPlugin(GajimPlugin):
for
account
in
app
.
connections
:
if
app
.
account_is_connected
(
account
):
connection
=
app
.
connections
[
account
]
connection
.
send_activity
(
activity
,
subactivity
,
last_fact
[
'fact'
])
connection
.
get_module
(
'UserActivity'
).
send
(
(
activity
,
subactivity
,
last_fact
[
'fact'
])
)
def
from_dbus_fact
(
self
,
fact
):
'''unpack the struct into a proper dict'''
...
...
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