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
358302fe
Commit
358302fe
authored
Nov 20, 2018
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove chatstates plugin
The functionality is implemented in Gajim
parent
1ba6c872
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
124 deletions
+0
-124
chatstate/__init__.py
chatstate/__init__.py
+0
-1
chatstate/chatstate.png
chatstate/chatstate.png
+0
-0
chatstate/chatstate.py
chatstate/chatstate.py
+0
-112
chatstate/manifest.ini
chatstate/manifest.ini
+0
-11
No files found.
chatstate/__init__.py
deleted
100644 → 0
View file @
1ba6c872
from
.chatstate
import
ChatstatePlugin
chatstate/chatstate.png
deleted
100644 → 0
View file @
1ba6c872
327 Bytes
chatstate/chatstate.py
deleted
100644 → 0
View file @
1ba6c872
import
unicodedata
from
gi.repository
import
GObject
from
gajim.plugins
import
GajimPlugin
from
gajim.plugins.helpers
import
log_calls
from
gajim.common
import
ged
from
gajim.common
import
app
from
gajim.common
import
helpers
from
gajim
import
gtkgui_helpers
# Since Gajim 1.1.0 _() has to be imported
try
:
from
gajim.common.i18n
import
_
except
ImportError
:
pass
def
paragraph_direction_mark
(
text
):
"""
Determine paragraph writing direction according to
http://www.unicode.org/reports/tr9/#The_Paragraph_Level
Returns either Unicode LTR mark or RTL mark.
"""
for
char
in
text
:
bidi
=
unicodedata
.
bidirectional
(
char
)
if
bidi
==
'L'
:
return
'
\u200E
'
elif
bidi
==
'AL'
or
bidi
==
'R'
:
return
'
\u200F
'
return
'
\u200E
'
class
ChatstatePlugin
(
GajimPlugin
):
@
log_calls
(
'ChatstatePlugin'
)
def
init
(
self
):
self
.
description
=
_
(
'Chat State Notifications in roster.'
'Font color of the contact varies depending on the chat state.
\n
'
'The plugin does not work if you use custom font color for contacts in roster.
\n
'
'https://dev.gajim.org/gajim/gajim/issues/3628
\n
http://xmpp.org/extensions/xep-0085.html'
)
self
.
config_dialog
=
None
# ChatstatePluginConfigDialog(self)
self
.
events_handlers
=
{
'chatstate-received'
:
(
ged
.
GUI2
,
self
.
chatstate_received
),
}
self
.
active
=
None
def
chatstate_received
(
self
,
obj
):
if
not
self
.
active
:
return
contact
=
app
.
contacts
.
get_contact_from_full_jid
(
obj
.
conn
.
name
,
obj
.
fjid
)
if
not
contact
:
return
chatstate
=
obj
.
chatstate
if
chatstate
not
in
self
.
chatstates
.
keys
():
return
self
.
model
=
app
.
interface
.
roster
.
model
child_iters
=
app
.
interface
.
roster
.
_get_contact_iter
(
obj
.
jid
,
obj
.
conn
.
name
,
contact
,
self
.
model
)
name
=
GObject
.
markup_escape_text
(
contact
.
get_shown_name
())
contact_instances
=
app
.
contacts
.
get_contacts
(
obj
.
conn
.
name
,
contact
.
jid
)
# Show resource counter
nb_connected_contact
=
0
for
c
in
contact_instances
:
if
c
.
show
not
in
(
'error'
,
'offline'
):
nb_connected_contact
+=
1
if
nb_connected_contact
>
1
:
name
+=
paragraph_direction_mark
(
name
)
name
+=
' (%d)'
%
nb_connected_contact
for
child_iter
in
child_iters
:
if
chatstate
!=
'gone'
:
color
=
self
.
chatstates
[
chatstate
]
name
=
'<span foreground="%s">%s</span>'
%
(
color
,
name
)
if
contact
.
status
and
app
.
config
.
get
(
'show_status_msgs_in_roster'
):
status
=
contact
.
status
.
strip
()
if
status
!=
''
:
status
=
helpers
.
reduce_chars_newlines
(
status
,
max_lines
=
1
)
name
+=
'
\n
<span size="small" style="italic" '
\
'foreground="%s">%s</span>'
%
(
self
.
status_color
,
GObject
.
markup_escape_text
(
status
))
self
.
model
[
child_iter
][
1
]
=
name
@
log_calls
(
'ChatstatePlugin'
)
def
activate
(
self
):
color
=
gtkgui_helpers
.
get_fade_color
(
app
.
interface
.
roster
.
tree
,
False
,
False
)
self
.
status_color
=
'#%02x%02x%02x'
%
(
int
(
color
.
red
*
255
),
int
(
color
.
green
*
255
),
int
(
color
.
blue
*
255
))
theme
=
app
.
config
.
get
(
'roster_theme'
)
self
.
chatstates
=
{
'active'
:
app
.
config
.
get
(
'inmsgcolor'
),
'composing'
:
app
.
config
.
get_per
(
'themes'
,
theme
,
'state_composing_color'
),
'inactive'
:
app
.
config
.
get_per
(
'themes'
,
theme
,
'state_inactive_color'
),
'paused'
:
app
.
config
.
get_per
(
'themes'
,
theme
,
'state_paused_color'
),
'gone'
:
None
,
}
self
.
active
=
True
@
log_calls
(
'ChatstatePlugin'
)
def
deactivate
(
self
):
self
.
active
=
False
chatstate/manifest.ini
deleted
100644 → 0
View file @
1ba6c872
[info]
name:
Chatstate
in
roster
short_name:
chatstate
version:
1.2.0
description:
Chat
State
Notifications
in
roster.
Font
color
of
the
contact
varies
depending
on
the
chat
state.
The
plugin
does
not
work
if
you
use
custom
font
color
for
contacts
in
roster.
authors:
Denis
Fomin
<fominde@gmail.com>
homepage:
https://dev.gajim.org/gajim/gajim-plugins/wikis/ChatstatePlugin
min_gajim_version:
1.1.91
max_gajim_version:
1.2.90
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