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
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
199
Issues
199
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
6bb94cdf
Commit
6bb94cdf
authored
Jan 11, 2011
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Displays the subscription and Ask states in the roster
parent
f7102ae3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
src/contact.py
src/contact.py
+1
-1
src/tabs.py
src/tabs.py
+6
-0
src/windows.py
src/windows.py
+16
-8
No files found.
src/contact.py
View file @
6bb94cdf
...
...
@@ -147,7 +147,7 @@ class Contact(object):
def
set_subscription
(
self
,
sub
):
self
.
_subscription
=
sub
def
get_subscription
(
self
,
sub
):
def
get_subscription
(
self
):
return
self
.
_subscription
def
get_nb_resources
(
self
):
...
...
src/tabs.py
View file @
6bb94cdf
...
...
@@ -757,6 +757,7 @@ class RosterInfoTab(Tab):
self
.
key_func
[
"o"
]
=
self
.
toggle_offline_show
self
.
key_func
[
"s"
]
=
self
.
start_search
self
.
key_func
[
"S"
]
=
self
.
start_search_slow
self
.
commands
[
'deny'
]
=
(
self
.
command_deny
,
_
(
"Usage: /deny [jid]
\n
Deny: Use this command to remove and deny your presence to the provided JID (or the selected contact in your roster), who is asking you to be in his/here roster"
),
self
.
completion_deny
)
self
.
resize
()
def
resize
(
self
):
...
...
@@ -776,6 +777,11 @@ class RosterInfoTab(Tab):
not
self
.
input
.
help_message
:
self
.
complete_commands
(
self
.
input
)
def
command_deny
(
self
,
args
):
"""
Denies a JID from our roster
"""
def
refresh
(
self
,
tabs
,
informations
,
roster
):
if
not
self
.
visible
:
return
...
...
src/windows.py
View file @
6bb94cdf
...
...
@@ -1268,13 +1268,13 @@ class RosterWin(Win):
else
:
presence
=
resource
.
get_presence
()
folder
=
'[+]'
if
contact
.
_folded
else
'[-]'
nb
=
'(%s)'
%
(
contact
.
get_nb_resources
(),)
nb
=
'
(%s)'
%
(
contact
.
get_nb_resources
(),)
color
=
RosterWin
.
color_show
[
presence
]
if
contact
.
get_name
():
display_name
=
'%s (%s)
%s'
%
(
contact
.
get_name
(),
display_name
=
'%s (%s)%s'
%
(
contact
.
get_name
(),
contact
.
get_bare_jid
(),
nb
,)
else
:
display_name
=
'%s
%s'
%
(
contact
.
get_bare_jid
(),
nb
,)
display_name
=
'%s%s'
%
(
contact
.
get_bare_jid
(),
nb
,)
self
.
addstr
(
y
,
1
,
" "
,
curses
.
color_pair
(
color
))
if
resource
:
self
.
addstr
(
y
,
2
,
' [+]'
if
contact
.
_folded
else
' [-]'
)
...
...
@@ -1283,6 +1283,8 @@ class RosterWin(Win):
self
.
addstr
(
display_name
,
curses
.
color_pair
(
14
))
else
:
self
.
addstr
(
display_name
)
if
contact
.
get_ask
():
self
.
addstr
(
'?'
,
curses
.
color_pair
(
1
))
def
draw_resource_line
(
self
,
y
,
resource
,
colored
):
"""
...
...
@@ -1305,17 +1307,24 @@ class ContactInfoWin(Win):
def
resize
(
self
,
height
,
width
,
y
,
x
,
stdscr
):
self
.
_resize
(
height
,
width
,
y
,
x
,
stdscr
)
def
draw_contact_info
(
self
,
resource
,
jid
=
None
):
def
draw_contact_info
(
self
,
contact
):
"""
draw the contact information
"""
jid
=
jid
or
resource
.
get_jid
().
full
if
contact
:
jid
=
contact
.
get_bare_jid
()
else
:
jid
=
jid
or
resource
.
get_jid
().
full
resource
=
contact
.
get_highest_priority_resource
()
if
resource
:
presence
=
resource
.
get_presence
()
else
:
presence
=
'unavailable'
self
.
addstr
(
0
,
0
,
'%s (%s)'
%
(
jid
,
presence
,),
curses
.
color_pair
(
theme
.
COLOR_INFORMATION_BAR
))
self
.
finish_line
(
theme
.
COLOR_INFORMATION_BAR
)
self
.
addstr
(
1
,
0
,
'Subscription: %s'
%
(
contact
.
get_subscription
(),))
if
contact
.
get_ask
():
self
.
addstr
(
' Ask: %s'
%
(
contact
.
get_ask
(),),
curses
.
color_pair
(
1
))
def
draw_group_info
(
self
,
group
):
"""
...
...
@@ -1330,10 +1339,9 @@ class ContactInfoWin(Win):
if
isinstance
(
selected_row
,
RosterGroup
):
self
.
draw_group_info
(
selected_row
)
elif
isinstance
(
selected_row
,
Contact
):
self
.
draw_contact_info
(
selected_row
.
get_highest_priority_resource
(),
selected_row
.
get_bare_jid
())
elif
isinstance
(
selected_row
,
Resource
):
self
.
draw_contact_info
(
selected_row
)
# elif isinstance(selected_row, Resource):
# self.draw_contact_info(None, selected_row)
self
.
_refresh
()
class
ListWin
(
Win
):
...
...
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