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
eta
gajim
Commits
c22f5db1
Commit
c22f5db1
authored
12 years ago
by
zimio
Browse files
Options
Downloads
Patches
Plain Diff
IBB supports file request
parent
a3c486f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/jingle_ft.py
+15
-6
15 additions, 6 deletions
src/common/jingle_ft.py
src/common/jingle_session.py
+1
-1
1 addition, 1 deletion
src/common/jingle_session.py
with
16 additions
and
7 deletions
src/common/jingle_ft.py
+
15
−
6
View file @
c22f5db1
...
...
@@ -69,13 +69,15 @@ class JingleFileTransfer(JingleContent):
self
.
callbacks
[
'
iq-result
'
]
+=
[
self
.
__on_iq_result
]
self
.
use_security
=
use_security
self
.
file_props
=
file_props
if
file_props
is
None
:
self
.
weinitiate
=
False
else
:
self
.
weinitiate
=
True
self
.
weinitiate
=
self
.
session
.
weinitiate
self
.
werequest
=
self
.
session
.
werequest
if
self
.
file_props
is
not
None
:
self
.
file_props
.
sender
=
session
.
ourjid
self
.
file_props
.
receiver
=
session
.
peerjid
if
self
.
session
.
werequest
:
self
.
file_props
.
sender
=
self
.
session
.
peerjid
self
.
file_props
.
receiver
=
self
.
session
.
ourjid
else
:
self
.
file_props
.
sender
=
self
.
session
.
ourjid
self
.
file_props
.
receiver
=
self
.
session
.
peerjid
self
.
file_props
.
session_type
=
'
jingle
'
self
.
file_props
.
sid
=
session
.
sid
self
.
file_props
.
transfered_size
=
[]
...
...
@@ -172,6 +174,9 @@ class JingleFileTransfer(JingleContent):
response
=
stanza
.
buildReply
(
'
result
'
)
response
.
delChild
(
response
.
getQuery
())
con
.
connection
.
send
(
response
)
# If we are requesting we don't have the file
if
self
.
session
.
werequest
:
raise
xmpp
.
NodeProcessed
# We send the file
self
.
__state_changed
(
STATE_TRANSFERING
)
raise
xmpp
.
NodeProcessed
...
...
@@ -359,6 +364,10 @@ class JingleFileTransfer(JingleContent):
else
:
return
self
.
weinitiate
def
start_IBB_transfer
(
self
):
if
self
.
file_props
.
type_
==
'
s
'
:
self
.
__state_changed
(
STATE_TRANSFERING
)
def
get_content
(
desc
):
return
JingleFileTransfer
...
...
This diff is collapsed.
Click to expand it.
src/common/jingle_session.py
+
1
−
1
View file @
c22f5db1
...
...
@@ -366,7 +366,6 @@ class JingleSession(object):
error_name
=
child
.
getName
()
self
.
__dispatch_error
(
error_name
,
text
,
error
.
getAttr
(
'
type
'
))
# FIXME: Not sure when we would want to do that...
def
transport_replace
(
self
):
transport
=
JingleTransportIBB
()
# For debug only, delete this and replace for a function
...
...
@@ -399,6 +398,7 @@ class JingleSession(object):
self
.
contents
[(
creator
,
name
)].
state
=
STATE_TRANSPORT_REPLACE
self
.
__ack
(
stanza
,
jingle
,
error
,
action
)
self
.
__session_accept
()
self
.
contents
[(
creator
,
name
)].
start_IBB_transfer
()
else
:
stanza
,
jingle
=
self
.
__make_jingle
(
'
transport-reject
'
)
content
=
jingle
.
setTag
(
'
content
'
,
attrs
=
{
'
creator
'
:
creator
,
...
...
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