Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
abcb48d1
Commit
abcb48d1
authored
17 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
improve pubsub support. fixes #3103
parent
fc153017
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/atom.py
+6
-6
6 additions, 6 deletions
src/common/atom.py
src/common/connection_handlers.py
+5
-12
5 additions, 12 deletions
src/common/connection_handlers.py
src/disco.py
+13
-5
13 additions, 5 deletions
src/disco.py
with
24 additions
and
23 deletions
src/common/atom.py
+
6
−
6
View file @
abcb48d1
...
@@ -63,10 +63,11 @@ class OldEntry(xmpp.Node, object):
...
@@ -63,10 +63,11 @@ class OldEntry(xmpp.Node, object):
else
:
else
:
main_feed
=
None
main_feed
=
None
if
self
.
getTag
(
'
source-
feed
'
)
is
not
None
:
if
self
.
getTag
(
'
feed
'
)
is
not
None
:
source_feed
=
self
.
getTag
(
'
source-
feed
'
).
getTagData
(
'
title
'
)
source_feed
=
self
.
getTag
(
'
feed
'
).
getTagData
(
'
title
'
)
else
:
else
:
source_feed
=
None
source_feed
=
None
if
main_feed
is
not
None
and
source_feed
is
not
None
:
if
main_feed
is
not
None
and
source_feed
is
not
None
:
return
u
'
%s: %s
'
%
(
main_feed
,
source_feed
)
return
u
'
%s: %s
'
%
(
main_feed
,
source_feed
)
...
@@ -78,14 +79,13 @@ class OldEntry(xmpp.Node, object):
...
@@ -78,14 +79,13 @@ class OldEntry(xmpp.Node, object):
return
u
''
return
u
''
feed_title
=
property
(
get_feed_title
,
None
,
None
,
feed_title
=
property
(
get_feed_title
,
None
,
None
,
'''
Title of feed. It is built from entry
'
s original feed title and title of feed
'''
Title of feed. It is built from entry
'
'
s original feed title and title of feed
which delivered this entry.
'''
)
which delivered this entry.
'''
)
def
get_feed_link
(
self
):
def
get_feed_link
(
self
):
'''
Get a link to main page of feed (in pubsub.com: second link of rel=
'
alternate
'
,
'''
Get source link
'''
first contains raw xml data).
'''
try
:
try
:
return
self
.
getTag
(
'
source-
feed
'
).
getTags
(
'
link
'
,
{
'
rel
'
:
'
alternate
'
})[
1
].
getData
()
return
self
.
getTag
(
'
feed
'
).
getTags
(
'
link
'
,{
'
rel
'
:
'
alternate
'
})[
1
].
getData
()
except
:
except
:
return
None
return
None
...
...
This diff is collapsed.
Click to expand it.
src/common/connection_handlers.py
+
5
−
12
View file @
abcb48d1
...
@@ -1557,20 +1557,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
...
@@ -1557,20 +1557,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
if
items
is
None
:
return
if
items
is
None
:
return
for
item
in
items
.
getTags
(
'
item
'
):
for
item
in
items
.
getTags
(
'
item
'
):
# check for event type (for now only one type supported: pubsub.com events)
entry
=
item
.
getTag
(
'
entry
'
)
child
=
item
.
getTag
(
'
pubsub-message
'
)
if
entry
is
not
None
:
if
child
is
not
None
:
# for each entry in feed (there shouldn't be more than one,
# we have pubsub.com notification
# but to be sure...
child
=
child
.
getTag
(
'
feed
'
)
self
.
dispatch
(
'
ATOM_ENTRY
'
,
(
atom
.
OldEntry
(
node
=
entry
),))
if
child
is
None
:
continue
for
entry
in
child
.
getTags
(
'
entry
'
):
# for each entry in feed (there shouldn't be more than one,
# but to be sure...
self
.
dispatch
(
'
ATOM_ENTRY
'
,
(
atom
.
OldEntry
(
node
=
entry
),))
continue
continue
# unknown type... probably user has another client who understands that event
# unknown type... probably user has another client who understands that event
raise
common
.
xmpp
.
NodeProcessed
raise
common
.
xmpp
.
NodeProcessed
def
_presenceCB
(
self
,
con
,
prs
):
def
_presenceCB
(
self
,
con
,
prs
):
...
...
This diff is collapsed.
Click to expand it.
src/disco.py
+
13
−
5
View file @
abcb48d1
...
@@ -76,7 +76,7 @@ def _gen_agent_type_info():
...
@@ -76,7 +76,7 @@ def _gen_agent_type_info():
(
'
_jid
'
,
'
weather
'
):
(
False
,
'
weather.png
'
),
(
'
_jid
'
,
'
weather
'
):
(
False
,
'
weather.png
'
),
(
'
gateway
'
,
'
sip
'
):
(
False
,
'
sip.png
'
),
(
'
gateway
'
,
'
sip
'
):
(
False
,
'
sip.png
'
),
(
'
directory
'
,
'
user
'
):
(
None
,
'
jud.png
'
),
(
'
directory
'
,
'
user
'
):
(
None
,
'
jud.png
'
),
(
'
pubsub
'
,
'
generic
'
):
(
None
,
'
pubsub.png
'
),
(
'
pubsub
'
,
'
generic
'
):
(
PubSubBrowser
,
'
pubsub.png
'
),
(
'
pubsub
'
,
'
service
'
):
(
PubSubBrowser
,
'
pubsub.png
'
),
(
'
pubsub
'
,
'
service
'
):
(
PubSubBrowser
,
'
pubsub.png
'
),
(
'
proxy
'
,
'
bytestreams
'
):
(
None
,
'
bytestreams.png
'
),
# Socks5 FT proxy
(
'
proxy
'
,
'
bytestreams
'
):
(
None
,
'
bytestreams.png
'
),
# Socks5 FT proxy
...
@@ -1792,7 +1792,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
...
@@ -1792,7 +1792,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
'''
Create treemodel for the window.
'''
'''
Create treemodel for the window.
'''
# JID, node, name (with description) - pango markup, dont have info?, subscribed?
# JID, node, name (with description) - pango markup, dont have info?, subscribed?
self
.
model
=
gtk
.
ListStore
(
str
,
str
,
str
,
bool
,
bool
)
self
.
model
=
gtk
.
ListStore
(
str
,
str
,
str
,
bool
,
bool
)
self
.
model
.
set_sort_column_id
(
3
,
gtk
.
SORT_ASCENDING
)
# sort by name
self
.
model
.
set_sort_column_id
(
2
,
gtk
.
SORT_ASCENDING
)
self
.
window
.
services_treeview
.
set_model
(
self
.
model
)
self
.
window
.
services_treeview
.
set_model
(
self
.
model
)
# Name column
# Name column
...
@@ -1803,7 +1804,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
...
@@ -1803,7 +1804,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
col
.
pack_start
(
renderer
)
col
.
pack_start
(
renderer
)
col
.
set_attributes
(
renderer
,
markup
=
2
)
col
.
set_attributes
(
renderer
,
markup
=
2
)
col
.
set_resizable
(
True
)
col
.
set_resizable
(
True
)
self
.
window
.
services_treeview
.
insert_column
(
col
,
-
1
)
self
.
window
.
services_treeview
.
insert_column
(
col
,
-
1
)
self
.
window
.
services_treeview
.
set_headers_visible
(
True
)
# Subscription state
# Subscription state
renderer
=
gtk
.
CellRendererToggle
()
renderer
=
gtk
.
CellRendererToggle
()
...
@@ -1813,7 +1815,13 @@ class DiscussionGroupsBrowser(AgentBrowser):
...
@@ -1813,7 +1815,13 @@ class DiscussionGroupsBrowser(AgentBrowser):
col
.
set_resizable
(
False
)
col
.
set_resizable
(
False
)
self
.
window
.
services_treeview
.
insert_column
(
col
,
-
1
)
self
.
window
.
services_treeview
.
insert_column
(
col
,
-
1
)
self
.
window
.
services_treeview
.
set_headers_visible
(
True
)
# Node Column
renderer
=
gtk
.
CellRendererText
()
col
=
gtk
.
TreeViewColumn
(
_
(
'
Node
'
))
col
.
pack_start
(
renderer
)
col
.
set_attributes
(
renderer
,
markup
=
1
)
col
.
set_resizable
(
True
)
self
.
window
.
services_treeview
.
insert_column
(
col
,
-
1
)
def
_add_item
(
self
,
jid
,
node
,
item
,
force
):
def
_add_item
(
self
,
jid
,
node
,
item
,
force
):
'''
Called when we got basic information about new node from query.
'''
Called when we got basic information about new node from query.
...
@@ -1829,7 +1837,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
...
@@ -1829,7 +1837,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
name
=
gobject
.
markup_escape_text
(
name
)
name
=
gobject
.
markup_escape_text
(
name
)
name
=
'
<b>%s</b>
'
%
name
name
=
'
<b>%s</b>
'
%
name
self
.
model
.
append
((
jid
,
node
,
name
,
dunno
,
subscribed
))
self
.
model
.
append
((
jid
,
node
,
name
,
dunno
,
subscribed
))
def
_add_actions
(
self
):
def
_add_actions
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment