Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
c7668719
Commit
c7668719
authored
Jun 25, 2010
by
Luci Stanescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed support for SIP aliases
parent
0b405f14
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
contacts.py
blink/contacts.py
+7
-2
sessions.py
blink/sessions.py
+2
-2
contact_editor.ui
resources/contact_editor.ui
+3
-3
No files found.
blink/contacts.py
View file @
c7668719
...
...
@@ -159,6 +159,7 @@ class Contact(object):
self
.
name
=
name
self
.
uri
=
uri
self
.
image
=
image
self
.
sip_aliases
=
[]
self
.
preferred_media
=
'Audio'
self
.
status
=
'unknown'
...
...
@@ -169,7 +170,7 @@ class Contact(object):
return
u'
%
s <
%
s>'
%
(
self
.
name
,
self
.
uri
)
if
self
.
name
else
self
.
uri
def
__reduce__
(
self
):
return
(
self
.
__class__
,
(
self
.
group
,
self
.
name
,
self
.
uri
,
self
.
image
),
dict
(
preferred_media
=
self
.
preferred_media
))
return
(
self
.
__class__
,
(
self
.
group
,
self
.
name
,
self
.
uri
,
self
.
image
),
dict
(
preferred_media
=
self
.
preferred_media
,
sip_aliases
=
self
.
sip_aliases
))
def
_get_image
(
self
):
return
self
.
__dict__
[
'image'
]
...
...
@@ -1575,6 +1576,7 @@ class ContactEditorDialog(base_class, ui_class):
def
open_for_add
(
self
,
sip_address
=
u''
,
target_group
=
None
):
self
.
sip_address_editor
.
setText
(
sip_address
)
self
.
display_name_editor
.
setText
(
u''
)
self
.
sip_aliases_editor
.
setText
(
u''
)
for
index
in
xrange
(
self
.
group
.
count
()):
if
self
.
group
.
itemData
(
index
)
.
toPyObject
()
is
target_group
:
break
...
...
@@ -1591,6 +1593,7 @@ class ContactEditorDialog(base_class, ui_class):
self
.
edited_contact
=
contact
self
.
sip_address_editor
.
setText
(
contact
.
uri
)
self
.
display_name_editor
.
setText
(
contact
.
name
)
self
.
sip_aliases_editor
.
setText
(
u'; '
.
join
(
contact
.
sip_aliases
))
for
index
in
xrange
(
self
.
group
.
count
()):
if
self
.
group
.
itemData
(
index
)
.
toPyObject
()
is
contact
.
group
:
break
...
...
@@ -1616,6 +1619,7 @@ class ContactEditorDialog(base_class, ui_class):
name
=
unicode
(
self
.
display_name_editor
.
text
())
image
=
IconCache
()
.
store
(
self
.
icon_selector
.
filename
)
preferred_media
=
unicode
(
self
.
preferred_media
.
currentText
())
sip_aliases
=
[
alias
.
strip
()
for
alias
in
unicode
(
self
.
sip_aliases_editor
.
text
())
.
split
(
u';'
)]
group_index
=
self
.
group
.
currentIndex
()
group_name
=
self
.
group
.
currentText
()
if
group_name
!=
self
.
group
.
itemText
(
group_index
):
...
...
@@ -1629,9 +1633,10 @@ class ContactEditorDialog(base_class, ui_class):
group
=
self
.
group
.
itemData
(
group_index
)
.
toPyObject
()
if
self
.
edited_contact
is
None
:
contact
=
Contact
(
group
,
name
,
uri
,
image
)
contact
.
sip_aliases
=
sip_aliases
contact_model
.
addContact
(
contact
)
else
:
attributes
=
dict
(
group
=
group
,
name
=
name
,
uri
=
uri
,
image
=
image
,
preferred_media
=
preferred_media
)
attributes
=
dict
(
group
=
group
,
name
=
name
,
uri
=
uri
,
image
=
image
,
preferred_media
=
preferred_media
,
sip_aliases
=
sip_aliases
)
contact_model
.
updateContact
(
self
.
edited_contact
,
attributes
)
self
.
edited_contact
=
None
...
...
blink/sessions.py
View file @
c7668719
...
...
@@ -83,7 +83,7 @@ class SessionItem(QObject):
from
blink
import
Blink
self
.
remote_party_name
=
None
for
contact
in
Blink
()
.
main_window
.
contact_model
.
iter_contacts
():
if
uri
.
matches
(
contact
.
uri
):
if
uri
.
matches
(
contact
.
uri
)
or
any
(
uri
.
matches
(
alias
)
for
alias
in
contact
.
sip_aliases
)
:
self
.
remote_party_name
=
contact
.
name
break
if
not
self
.
remote_party_name
:
...
...
@@ -1568,7 +1568,7 @@ class IncomingSession(QObject):
address
=
u'
%
s@
%
s'
%
(
session
.
remote_identity
.
uri
.
user
,
session
.
remote_identity
.
uri
.
host
)
self
.
dialog
.
uri_label
.
setText
(
address
)
for
contact
in
Blink
()
.
main_window
.
contact_model
.
iter_contacts
():
if
session
.
remote_identity
.
uri
.
matches
(
contact
.
uri
):
if
session
.
remote_identity
.
uri
.
matches
(
contact
.
uri
)
or
any
(
session
.
remote_identity
.
uri
.
matches
(
alias
)
for
alias
in
contact
.
sip_aliases
)
:
self
.
dialog
.
username_label
.
setText
(
contact
.
name
or
session
.
remote_identity
.
display_name
or
address
)
self
.
dialog
.
user_icon
.
setPixmap
(
contact
.
icon
)
break
...
...
resources/contact_editor.ui
View file @
c7668719
...
...
@@ -175,7 +175,7 @@
</spacer>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
chat
_aliases_label"
>
<widget
class=
"QLabel"
name=
"
sip
_aliases_label"
>
<property
name=
"text"
>
<string>
SIP Aliases:
</string>
</property>
...
...
@@ -185,7 +185,7 @@
</widget>
</item>
<item
row=
"5"
column=
"1"
colspan=
"2"
>
<widget
class=
"LineEdit"
name=
"
chat
_aliases_editor"
>
<widget
class=
"LineEdit"
name=
"
sip
_aliases_editor"
>
<property
name=
"inactiveText"
stdset=
"0"
>
<string>
List of SIP addresses separated by ;
</string>
</property>
...
...
@@ -361,7 +361,7 @@
<tabstop>
group
</tabstop>
<tabstop>
clear_button
</tabstop>
<tabstop>
preferred_media
</tabstop>
<tabstop>
chat
_aliases_editor
</tabstop>
<tabstop>
sip
_aliases_editor
</tabstop>
<tabstop>
storage_place
</tabstop>
<tabstop>
subscribe_presence
</tabstop>
<tabstop>
subscribe_dialogs
</tabstop>
...
...
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