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
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
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-plugins
Commits
4da67cdf
Commit
4da67cdf
authored
Nov 01, 2018
by
Daniel Brötzmann
Committed by
Philipp Hörist
Nov 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hamster_integration] Fix imports, fix Activity sending and retracting
parent
0faa4163
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
hamster/hamster.py
hamster/hamster.py
+7
-12
No files found.
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
.
retract_activity
(
)
connection
.
get_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