Commit ff9bc4f9 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Treat type normal messages as chat

parent 493d00bc
......@@ -810,8 +810,7 @@ class ChatControl(ChatControlBase):
return True
if obj.conn.name != self.account:
return
if not obj.properties.type.is_chat:
return
if obj.session.control != self:
return
......
......@@ -246,7 +246,6 @@ class Config:
'confirm_block': [opt_str, '', _('Show a confirmation dialog to block a contact? Empty string means never show the dialog.')],
'enable_negative_priority': [opt_bool, False, _('If enabled, you will be able to set a negative priority to your account in the Accounts window. BE CAREFUL, when you are logged in with a negative priority, you will NOT receive any message from your server.')],
'show_contacts_number': [opt_bool, True, _('If enabled, Gajim will show both the number of online and total contacts in account rows as well as in group rows.')],
'treat_incoming_messages': [opt_str, 'chat', _('Can be empty, \'chat\' or \'normal\'. If not empty, all incoming messages are treated as if they were of this type.')],
'scroll_roster_to_last_message': [opt_bool, True, _('If enabled, Gajim will scroll and select the contact who sent you the last message, if the chat window is not already opened.')],
'change_status_window_timeout': [opt_int, 15, _('Time of inactivity needed before the change status window closes down.')],
'max_conversation_lines': [opt_int, 500, _('Maximum number of lines that are printed in conversations. Oldest lines are cleared.')],
......
......@@ -367,10 +367,7 @@ class NotificationEvent(nec.NetworkIncomingEvent):
# We don't want message preview, do_preview = False
self.popup_text = ''
if msg_obj.properties.type.is_normal: # single message
self.popup_msg_type = 'normal'
self.popup_event_type = _('New Single Message')
elif msg_obj.properties.is_muc_pm:
if msg_obj.properties.is_muc_pm:
self.popup_msg_type = 'pm'
self.popup_event_type = _('New Private Message')
else: # chat message
......
......@@ -85,9 +85,6 @@ class ChatEvent(Event):
additional_data = AdditionalDataDict()
self.additional_data = additional_data
class NormalEvent(ChatEvent):
type_ = 'normal'
class PmEvent(ChatEvent):
type_ = 'pm'
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="48"
id="svg5868"
sodipodi:version="0.32"
inkscape:version="0.44+devel"
sodipodi:docbase="/home/cornelius/Desktop/GAJIM iconset/sources"
sodipodi:docname="single_msg_recv.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.0"
inkscape:export-filename="/home/cornelius/Desktop/GAJIM iconset/data/pixmaps/events/single_msg_recv.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:modified="TRUE">
<defs
id="defs5870">
<linearGradient
inkscape:collect="always"
id="linearGradient6166">
<stop
style="stop-color:#73d216;stop-opacity:1"
offset="0"
id="stop6168" />
<stop
style="stop-color:#66ba13;stop-opacity:1"
offset="1"
id="stop6170" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="24.999996"
x2="10.000471"
y1="24.999996"
x1="8.8586321"
id="linearGradient3811"
xlink:href="#linearGradient3805"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="13.072449"
x2="15.5"
y1="0.10591315"
x1="15.5"
id="linearGradient3173"
xlink:href="#linearGradient3167"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="15.460861"
x2="11.313708"
y1="10.041267"
x1="11.313708"
id="linearGradient3142"
xlink:href="#linearGradient3136"
inkscape:collect="always" />
<linearGradient
y2="38.184418"
x2="19.293913"
y1="14.866997"
x1="19.293913"
gradientTransform="matrix(1,0,0,1.019549,-31.40102,-3.714102)"
gradientUnits="userSpaceOnUse"
id="linearGradient3122"
xlink:href="#linearGradient3124"
inkscape:collect="always" />
<linearGradient
gradientTransform="matrix(0.876811,0,0,0.884616,2.431162,6.557698)"
y2="38.184418"
x2="19.293913"
y1="14.866997"
x1="19.293913"
gradientUnits="userSpaceOnUse"
id="linearGradient3095"
xlink:href="#linearGradient3058"
inkscape:collect="always" />
<linearGradient
gradientTransform="matrix(0.876811,0,0,0.937062,2.431162,6.381118)"
y2="38.184418"
x2="19.293913"
y1="14.866997"
x1="19.293913"
gradientUnits="userSpaceOnUse"
id="linearGradient3093"
xlink:href="#linearGradient3058"
inkscape:collect="always" />
<linearGradient
id="linearGradient3058"
inkscape:collect="always">
<stop
id="stop3060"
offset="0"
style="stop-color:#fafaf9;stop-opacity:1;" />
<stop
id="stop3062"
offset="1"
style="stop-color:#ececec;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3124">
<stop
style="stop-color:#fafaf9;stop-opacity:1;"
offset="0"
id="stop3126" />
<stop
style="stop-color:#d7d7d7;stop-opacity:1"
offset="1"
id="stop3128" />
</linearGradient>
<linearGradient
id="linearGradient3136"
inkscape:collect="always">
<stop
id="stop3138"
offset="0"
style="stop-color:#ef2929;stop-opacity:1" />
<stop
id="stop3140"
offset="1"
style="stop-color:#ba0000;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient3167"
inkscape:collect="always">
<stop
id="stop3169"
offset="0"
style="stop-color:white;stop-opacity:1;" />
<stop
id="stop3171"
offset="1"
style="stop-color:white;stop-opacity:0;" />
</linearGradient>
<linearGradient
y2="609.5199"
x2="512.28497"
y1="365.21631"
x1="512.28497"
gradientTransform="matrix(3.659125,0,0,1.892176,-1492.258,-825.6305)"
gradientUnits="userSpaceOnUse"
id="linearGradient3255"
xlink:href="#linearGradient5048"
inkscape:collect="always" />
<linearGradient
id="linearGradient5048">
<stop
id="stop5050"
offset="0"
style="stop-color:black;stop-opacity:0;" />
<stop
style="stop-color:black;stop-opacity:1;"
offset="0.5"
id="stop5056" />
<stop
id="stop5052"
offset="1"
style="stop-color:black;stop-opacity:0;" />
</linearGradient>
<radialGradient
r="117.14286"
fy="488.07959"
fx="602.65948"
cy="488.07959"
cx="602.65948"
gradientTransform="matrix(2.746819,0,0,1.900281,-941.7278,-828.6181)"
gradientUnits="userSpaceOnUse"
id="radialGradient3257"
xlink:href="#linearGradient5060"
inkscape:collect="always" />
<linearGradient
id="linearGradient5060"
inkscape:collect="always">
<stop
id="stop5062"
offset="0"
style="stop-color:black;stop-opacity:1;" />
<stop
id="stop5064"
offset="1"
style="stop-color:black;stop-opacity:0;" />
</linearGradient>
<radialGradient
r="117.14286"
fy="486.64789"
fx="605.71429"
cy="486.64789"
cx="605.71429"
gradientTransform="matrix(-2.74682,0,0,1.900281,602.2346,-828.6181)"
gradientUnits="userSpaceOnUse"
id="radialGradient3259"
xlink:href="#linearGradient5060"
inkscape:collect="always" />
<linearGradient
id="linearGradient3805"
inkscape:collect="always">
<stop
id="stop3807"
offset="0"
style="stop-color:white;stop-opacity:1;" />
<stop
id="stop3809"
offset="1"
style="stop-color:white;stop-opacity:0;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3167"
id="linearGradient6126"
gradientUnits="userSpaceOnUse"
x1="15.5"
y1="0.10591315"
x2="15.5"
y2="13.072449"
gradientTransform="translate(-19.999995,-21)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3136"
id="linearGradient6131"
gradientUnits="userSpaceOnUse"
x1="11.313708"
y1="10.041267"
x2="11.313708"
y2="15.460861"
gradientTransform="translate(-19.999995,-21)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3805"
id="linearGradient6134"
gradientUnits="userSpaceOnUse"
x1="8.8586321"
y1="24.999996"
x2="10.000471"
y2="24.999996"
gradientTransform="translate(-19.999995,-21)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3124"
id="linearGradient6137"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,1.019549,-51.401015,-24.714102)"
x1="19.293913"
y1="14.866997"
x2="19.293913"
y2="38.184418" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3058"
id="linearGradient6142"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.876811,0,0,0.937062,3.4311673,1.381118)"
x1="19.293913"
y1="14.866997"
x2="19.293913"
y2="38.184418" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3058"
id="linearGradient6146"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.876811,0,0,0.884616,3.4311673,1.557698)"
x1="19.293913"
y1="14.866997"
x2="19.293913"
y2="38.184418" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5048"
id="linearGradient6152"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.659125,0,0,1.892176,-1492.258,-825.6305)"
x1="512.28497"
y1="365.21631"
x2="512.28497"
y2="609.5199" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient5060"
id="radialGradient6154"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(2.746819,0,0,1.900281,-941.7278,-828.6181)"
cx="602.65948"
cy="488.07959"
fx="602.65948"
fy="488.07959"
r="117.14286" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient5060"
id="radialGradient6156"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-2.74682,0,0,1.900281,602.2346,-828.6181)"
cx="605.71429"
cy="486.64789"
fx="605.71429"
fy="486.64789"
r="117.14286" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6166"
id="linearGradient6172"
x1="21.213203"
y1="14.47671"
x2="30.598438"
y2="16.501608"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,1)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6166"
id="linearGradient6178"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,1)"
x1="21.213203"
y1="14.47671"
x2="30.598438"
y2="16.501608" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.556349"
inkscape:cx="31.303969"
inkscape:cy="18.925734"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="947"
inkscape:window-height="907"
inkscape:window-x="10"
inkscape:window-y="26"
width="48px"
height="48px" />
<metadata
id="metadata5873">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
style="opacity:0.6157205;display:inline"
transform="matrix(1.754551e-2,0,0,1.733565e-2,27.478325,34.28602)"
id="g3197">
<rect
style="opacity:0.40206185;color:#000000;fill:url(#linearGradient6152);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
id="rect3199"
width="1766.8337"
height="459.52847"
x="-1053.1652"
y="-131.86813" />
<path
style="opacity:0.40200004;color:#000000;fill:url(#radialGradient6154);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
d="M 713.66862,-131.86814 C 713.66862,-131.86814 713.66862,329.60325 713.66862,329.60325 C 855.12298,330.47196 1055.6366,226.21092 1055.6365,98.837854 C 1055.6365,-28.535234 897.78402,-131.86813 713.66862,-131.86814 z "
id="path3201"
sodipodi:nodetypes="cccc" />
<path
sodipodi:nodetypes="cccc"
id="path3203"
d="M -1053.1653,-131.86814 C -1053.1653,-131.86814 -1053.1653,329.60325 -1053.1653,329.60325 C -1194.6198,330.47196 -1395.1333,226.21093 -1395.1333,98.837855 C -1395.1333,-28.535231 -1237.2808,-131.86812 -1053.1653,-131.86814 z "
style="opacity:0.40200004;color:#000000;fill:url(#radialGradient6156);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
</g>
<rect
style="color:#000000;fill:url(#linearGradient6146);fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3056"
width="35.949223"
height="22.999994"
x="6.5000052"
y="13.500002"
rx="2.0101535"
ry="2.0101528" />
<path
sodipodi:nodetypes="ccc"
id="path3090"
d="M 6.9384114,35.500015 L 24.069424,22.322619 L 41.959676,35.312354"
style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:1.00000083px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.40540538" />
<path
style="color:#000000;fill:url(#linearGradient6142);fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:0.99999964px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 6.9384114,14.499997 L 23.090611,28.146213 C 23.656428,28.546486 24.278528,28.684233 25.045452,28.146453 L 41.959676,14.707768"
id="path3066"
sodipodi:nodetypes="cccc" />
<rect
ry="0.9877466"
rx="0.9877466"
y="14.499983"
x="7.5000095"
height="20.999998"
width="34.000004"
id="rect3086"
style="color:#000000;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccc"
id="path3790"
d="M 8.5000066,14.382261 L 23.213307,27.032174 C 23.73031,27.407223 24.026015,27.53629 24.726777,27.032398 L 40.499998,14.576939"
style="color:#000000;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<g
id="g6174"
transform="translate(13,20)">
<path
sodipodi:nodetypes="cccccccccc"
id="rect6158"
d="M 20.398189,6.496401 C 19.899589,6.496401 19.498189,6.897801 19.498189,7.396401 L 19.498189,14.483907 L 16.174966,14.5 L 23.46875,21.307153 L 30.857176,14.5 L 27.509846,14.483907 L 27.509846,7.396401 C 27.509846,6.897801 27.108446,6.496401 26.609846,6.496401 L 20.398189,6.496401 z "
style="opacity:1;color:#000000;fill:url(#linearGradient6178);fill-opacity:1;fill-rule:nonzero;stroke:#4e9a06;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
style="opacity:0.5414847;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 20.988352,7.4999998 C 20.553569,7.4999998 20.492815,7.5263842 20.492815,7.9584005 L 20.492815,15.481505 L 18.6777,15.495448 L 23.473063,19.985741 L 28.322928,15.495448 L 26.514819,15.481505 L 26.514819,7.9905417 C 26.514819,7.5585254 26.421924,7.4999998 25.98714,7.4999998 L 20.988352,7.4999998 z "
id="path6164"
sodipodi:nodetypes="cccccccccc" />
</g>
</g>
</svg>
......@@ -125,8 +125,6 @@ class Notification:
if obj.notif_type == 'msg':
if obj.base_event.properties.is_muc_pm:
return 'gajim-priv_msg_recv'
if obj.base_event.properties.type.is_normal:
return 'gajim-single_msg_recv'
elif obj.notif_type == 'pres':
if obj.transport_name is not None:
......@@ -167,7 +165,7 @@ class Notification:
notif_id = None
if event_type in (
_('Contact Signed In'), _('Contact Signed Out'),
_('New Message'), _('New Single Message'), _('New Private Message'),
_('New Message'), _('New Private Message'),
_('New Group Chat Message'),
_('Contact Changed Status'), _('File Transfer Request'),
_('File Transfer Error'), _('File Transfer Completed'),
......@@ -197,7 +195,6 @@ class Notification:
elif event_type == _('Connection Failed'):
notif_id = self._make_id('connection-failed', account)
elif event_type in (_('New Message'),
_('New Single Message'),
_('New Private Message'),
_('New Group Chat Message')):
if app.desktop_env == 'gnome':
......@@ -268,7 +265,7 @@ class PopupNotification(Gtk.Window):
bg_color = app.config.get('notif_signin_color')
elif event_type == _('Contact Signed Out'):
bg_color = app.config.get('notif_signout_color')
elif event_type in (_('New Message'), _('New Single Message'),
elif event_type in (_('New Message'),
_('New Private Message'), _('New E-mail')):
bg_color = app.config.get('notif_message_color')
elif event_type == _('File Transfer Request'):
......
......@@ -1238,7 +1238,7 @@ class Interface:
ctrl = self.new_private_chat(gc_contact, account)
w = ctrl.parent_win
elif type_ in ('normal', 'file-request', 'file-request-error',
elif type_ in ('file-request', 'file-request-error',
'file-send-error', 'file-error', 'file-stopped', 'file-completed',
'file-hash-error', 'jingle-incoming'):
# Get the first single message event
......
......@@ -2654,14 +2654,8 @@ class RosterWindow:
return True
if obj.properties.type.value not in ('normal', 'chat'):
return
if obj.properties.type.is_normal and obj.popup:
# it's single message to be autopopuped
SingleMessageWindow(obj.conn.name, obj.jid,
action='receive', from_whom=obj.jid, subject=obj.subject,
message=obj.msgtxt, resource=obj.resource, session=obj.session)
return
if obj.popup and obj.properties.type.is_chat and not obj.session.control:
if obj.popup and not obj.session.control:
contact = app.contacts.get_contact(obj.conn.name, obj.jid)
obj.session.control = app.interface.new_chat(contact,
obj.conn.name, session=obj.session)
......
......@@ -28,7 +28,6 @@ from gajim.common import contacts
from gajim.common import ged
from gajim.common.helpers import AdditionalDataDict
from gajim.common.const import KindConstant
from gajim.gtk.single_message import SingleMessageWindow
from gajim.gtk.util import get_show_in_roster
from gajim.gtk.util import get_show_in_systray
......@@ -100,21 +99,12 @@ class ChatControlSession:
if self.control.resource:
self.control.change_resource(self.resource)
if obj.properties.type.is_chat:
if not obj.msgtxt:
return
log_type = KindConstant.CHAT_MSG_RECV
if obj.forwarded and obj.sent:
log_type = KindConstant.CHAT_MSG_SENT
else:
log_type = KindConstant.SINGLE_MSG_RECV
if obj.forwarded and obj.sent:
log_type = KindConstant.SINGLE_MSG_SENT
if not obj.msgtxt:
return
treat_as = app.config.get('treat_incoming_messages')
if treat_as:
obj.mtype = treat_as
log_type = KindConstant.CHAT_MSG_RECV
if obj.forwarded and obj.sent:
log_type = KindConstant.CHAT_MSG_SENT
if self.is_loggable() and obj.msgtxt:
if obj.xhtml and app.config.get('log_xhtml_messages'):
......@@ -211,11 +201,7 @@ class ChatControlSession:
event_t = events.ChatEvent
event_type = 'message_received'
if obj.properties.type.is_normal:
event_t = events.NormalEvent
event_type = 'single_message_received'
if self.control and not obj.properties.type.is_normal:
if self.control:
# We have a ChatControl open
obj.show_in_roster = False
obj.show_in_systray = False
......@@ -236,10 +222,7 @@ class ChatControlSession:
# Everything else
obj.show_in_roster = get_show_in_roster(event_type, self)
obj.show_in_systray = get_show_in_systray(event_type, contact.jid)
if obj.properties.type.is_normal and obj.popup:
do_event = False
else:
do_event = True
do_event = True
if do_event: