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
ec373e4b
Commit
ec373e4b
authored
Apr 05, 2017
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[httpupload] Add oob tag with url data
This will only be added on not encrypted Messages
parent
b2364766
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
httpupload/httpupload.py
httpupload/httpupload.py
+17
-7
No files found.
httpupload/httpupload.py
View file @
ec373e4b
...
@@ -84,16 +84,19 @@ class HttpuploadPlugin(GajimPlugin):
...
@@ -84,16 +84,19 @@ class HttpuploadPlugin(GajimPlugin):
self
.
available_text
=
DEP_MSG
self
.
available_text
=
DEP_MSG
self
.
config_dialog
=
None
# HttpuploadPluginConfigDialog(self)
self
.
config_dialog
=
None
# HttpuploadPluginConfigDialog(self)
self
.
controls
=
[]
self
.
controls
=
[]
self
.
events_handlers
=
{}
self
.
events_handlers
=
{
self
.
events_handlers
[
'agent-info-received'
]
=
(
ged
.
PRECORE
,
'agent-info-received'
:
(
self
.
handle_agent_info_received
)
ged
.
PRECORE
,
self
.
handle_agent_info_received
),
self
.
events_handlers
[
'raw-iq-received'
]
=
(
ged
.
PRECORE
,
'stanza-message-outgoing'
:
(
self
.
handle_iq_received
)
ged
.
PRECORE
,
self
.
handle_outgoing_stanza
),
'raw-iq-received'
:
(
ged
.
PRECORE
,
self
.
handle_iq_received
)}
self
.
gui_extension_points
=
{
self
.
gui_extension_points
=
{
'chat_control_base'
:
(
self
.
connect_with_chat_control
,
'chat_control_base'
:
(
self
.
connect_with_chat_control
,
self
.
disconnect_from_chat_control
),
self
.
disconnect_from_chat_control
),
'chat_control_base_update_toolbar'
:
(
self
.
update_button_state
,
'chat_control_base_update_toolbar'
:
(
self
.
update_button_state
,
None
)}
None
)}
self
.
messages
=
[]
self
.
first_run
=
True
self
.
first_run
=
True
def
handle_iq_received
(
self
,
event
):
def
handle_iq_received
(
self
,
event
):
...
@@ -117,6 +120,13 @@ class HttpuploadPlugin(GajimPlugin):
...
@@ -117,6 +120,13 @@ class HttpuploadPlugin(GajimPlugin):
for
base
in
self
.
controls
:
for
base
in
self
.
controls
:
self
.
update_button_state
(
base
.
chat_control
)
self
.
update_button_state
(
base
.
chat_control
)
def
handle_outgoing_stanza
(
self
,
event
):
message
=
event
.
msg_iq
.
getTagData
(
'body'
)
if
message
and
message
in
self
.
messages
:
self
.
messages
.
remove
(
message
)
oob
=
event
.
msg_iq
.
addChild
(
'x'
,
namespace
=
nbxmpp
.
NS_X_OOB
)
oob
.
addChild
(
'url'
).
setData
(
message
)
@
log_calls
(
'HttpuploadPlugin'
)
@
log_calls
(
'HttpuploadPlugin'
)
def
connect_with_chat_control
(
self
,
control
):
def
connect_with_chat_control
(
self
,
control
):
self
.
chat_control
=
control
self
.
chat_control
=
control
...
@@ -456,12 +466,12 @@ class Base(object):
...
@@ -456,12 +466,12 @@ class Base(object):
(
get
.
getData
(),
get
.
getData
(),
thumb
)
(
get
.
getData
(),
get
.
getData
(),
thumb
)
progress_window
.
close_dialog
()
progress_window
.
close_dialog
()
id_
=
gajim
.
get_an_id
()
id_
=
gajim
.
get_an_id
()
def
add_oob_tag
():
pass
if
self
.
encrypted_upload
:
if
self
.
encrypted_upload
:
keyAndIv
=
'#'
+
binascii
.
hexlify
(
iv
)
+
binascii
.
hexlify
(
key
)
keyAndIv
=
'#'
+
binascii
.
hexlify
(
iv
)
+
binascii
.
hexlify
(
key
)
self
.
chat_control
.
send_message
(
message
=
get
.
getData
()
+
keyAndIv
,
xhtml
=
None
)
self
.
chat_control
.
send_message
(
message
=
get
.
getData
()
+
keyAndIv
,
xhtml
=
None
)
else
:
else
:
self
.
plugin
.
messages
.
append
(
get
.
getData
())
self
.
chat_control
.
send_message
(
message
=
get
.
getData
(),
xhtml
=
xhtml
)
self
.
chat_control
.
send_message
(
message
=
get
.
getData
(),
xhtml
=
xhtml
)
self
.
chat_control
.
msg_textview
.
grab_focus
()
self
.
chat_control
.
msg_textview
.
grab_focus
()
else
:
else
:
...
...
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