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
John Smith
gajim
Commits
d00eb5d1
Commit
d00eb5d1
authored
13 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
prevent traceback when obj.msg_id is not set
parent
e7c377dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/session.py
+6
-8
6 additions, 8 deletions
src/session.py
with
6 additions
and
8 deletions
src/session.py
+
6
−
8
View file @
d00eb5d1
...
...
@@ -73,7 +73,7 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
if
self
.
control
and
self
.
control
.
resource
:
self
.
control
.
change_resource
(
self
.
resource
)
msg_id
=
None
obj
.
msg_id
=
None
if
obj
.
mtype
==
'
chat
'
:
if
not
obj
.
stanza
.
getTag
(
'
body
'
)
and
obj
.
chatstate
is
None
:
...
...
@@ -89,7 +89,7 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
msg_to_log
=
obj
.
xhtml
else
:
msg_to_log
=
obj
.
msgtxt
msg_id
=
gajim
.
logger
.
write
(
log_type
,
obj
.
fjid
,
obj
.
msg_id
=
gajim
.
logger
.
write
(
log_type
,
obj
.
fjid
,
msg_to_log
,
tim
=
obj
.
timestamp
,
subject
=
obj
.
subject
)
except
exceptions
.
PysqliteOperationalError
,
e
:
self
.
conn
.
dispatch
(
'
ERROR
'
,
(
_
(
'
Disk WriteError
'
),
str
(
e
)))
...
...
@@ -101,8 +101,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
common
.
logger
.
LOG_DB_PATH
self
.
conn
.
dispatch
(
'
ERROR
'
,
(
pritext
,
sectext
))
obj
.
msg_id
=
msg_id
treat_as
=
gajim
.
config
.
get
(
'
treat_incoming_messages
'
)
if
treat_as
:
obj
.
mtype
=
treat_as
...
...
@@ -132,8 +130,8 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
# Brand new message, incoming.
contact
.
our_chatstate
=
obj
.
chatstate
contact
.
chatstate
=
obj
.
chatstate
if
msg_id
:
# Do not overwrite an existing msg_id with None
contact
.
msg_id
=
msg_id
if
obj
.
msg_id
:
# Do not overwrite an existing msg_id with None
contact
.
msg_id
=
obj
.
msg_id
# THIS MUST BE AFTER chatstates handling
# AND BEFORE playsound (else we ear sounding on chatstates!)
...
...
@@ -166,8 +164,8 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
if
gajim
.
interface
.
remote_ctrl
:
gajim
.
interface
.
remote_ctrl
.
raise_signal
(
'
NewMessage
'
,
(
self
.
conn
.
name
,
[
obj
.
fjid
,
obj
.
msgtxt
,
obj
.
timestamp
,
obj
.
encrypted
,
obj
.
mtype
,
obj
.
subject
,
obj
.
chatstate
,
msg_id
,
obj
.
user_nick
,
obj
.
xhtml
,
obj
.
form_node
]))
obj
.
encrypted
,
obj
.
mtype
,
obj
.
subject
,
obj
.
chatstate
,
obj
.
msg_id
,
obj
.
user_nick
,
obj
.
xhtml
,
obj
.
form_node
]))
def
roster_message2
(
self
,
obj
):
"""
...
...
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