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
a3688391
Commit
a3688391
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
[thorstenp] import rst generator only when needed. see #4457
parent
573ddce6
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/chat_control.py
+1
-1
1 addition, 1 deletion
src/chat_control.py
src/common/connection.py
+3
-2
3 additions, 2 deletions
src/common/connection.py
with
4 additions
and
3 deletions
src/chat_control.py
+
1
−
1
View file @
a3688391
...
...
@@ -48,7 +48,6 @@ from message_textview import MessageTextView
from
common.contacts
import
GC_Contact
from
common.logger
import
Constants
constants
=
Constants
()
from
common.rst_xhtml_generator
import
create_xhtml
from
common.pep
import
MOODS
,
ACTIVITIES
from
common.xmpp.protocol
import
NS_XHTML
,
NS_FILE
,
NS_MUC
,
NS_RECEIPTS
from
common.xmpp.protocol
import
NS_ESESSION
...
...
@@ -1872,6 +1871,7 @@ class ChatControl(ChatControlBase):
name
=
gajim
.
nicks
[
self
.
account
]
if
not
xhtml
and
not
encrypted
and
gajim
.
config
.
get
(
'
rst_formatting_outgoing_messages
'
):
from
common.rst_xhtml_generator
import
create_xhtml
xhtml
=
create_xhtml
(
text
)
if
xhtml
:
xhtml
=
'
<body xmlns=
"
%s
"
>%s</body>
'
%
(
NS_XHTML
,
xhtml
)
...
...
This diff is collapsed.
Click to expand it.
src/common/connection.py
+
3
−
2
View file @
a3688391
...
...
@@ -58,8 +58,6 @@ from common import exceptions
from
connection_handlers
import
*
from
common.rst_xhtml_generator
import
create_xhtml
from
string
import
Template
import
logging
log
=
logging
.
getLogger
(
'
gajim.c.connection
'
)
...
...
@@ -1078,6 +1076,7 @@ class Connection(ConnectionHandlers):
if
not
self
.
connection
:
return
1
if
msg
and
not
xhtml
and
gajim
.
config
.
get
(
'
rst_formatting_outgoing_messages
'
):
from
common.rst_xhtml_generator
import
create_xhtml
xhtml
=
create_xhtml
(
msg
)
if
not
msg
and
chatstate
is
None
and
form_node
is
None
:
return
2
...
...
@@ -1113,6 +1112,7 @@ class Connection(ConnectionHandlers):
if
msgtxt
and
not
xhtml
and
gajim
.
config
.
get
(
'
rst_formatting_outgoing_messages
'
):
# Generate a XHTML part using reStructured text markup
from
common.rst_xhtml_generator
import
create_xhtml
xhtml
=
create_xhtml
(
msgtxt
)
if
type_
==
'
chat
'
:
msg_iq
=
common
.
xmpp
.
Message
(
to
=
fjid
,
body
=
msgtxt
,
typ
=
type_
,
...
...
@@ -1558,6 +1558,7 @@ class Connection(ConnectionHandlers):
if
not
self
.
connection
:
return
if
not
xhtml
and
gajim
.
config
.
get
(
'
rst_formatting_outgoing_messages
'
):
from
common.rst_xhtml_generator
import
create_xhtml
xhtml
=
create_xhtml
(
msg
)
msg_iq
=
common
.
xmpp
.
Message
(
jid
,
msg
,
typ
=
'
groupchat
'
,
xhtml
=
xhtml
)
self
.
connection
.
send
(
msg_iq
)
...
...
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