mirror of
https://git.ugnet.gay/CrossTalk/azul.git
synced 2026-11-25 08:40:05 +00:00
bug fixes and improvements
- aliases are now handled properly in ABCH - removed final escargot leftovers (dev webconsole) - OSCAR etc. logging was not at log level debug - removed leftover debug code
This commit is contained in:
1 parent
4bf878556b
commit
6451bb9426
46 files changed
+307
-541
No files matched your search
@@ -1093,7 +1093,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
bs.me_accept_circle_invite(circle, send_events=False)
|
||||
backend.loop.create_task(_dispatch_circle_invite_status(backend, user, circle, False))
|
||||
except error.MemberNotInCircle:
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1101,7 +1101,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
'error': error_msg,
|
||||
}, status=500)
|
||||
except error.MemberAlreadyInCircle:
|
||||
error_msg = 'User `{email}` already accepted in `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` already accepted in `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1136,7 +1136,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
try:
|
||||
bs.me_invite_user_to_circle(circle, head, invite_message=invite_message)
|
||||
except error.MemberNotInCircle:
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1144,7 +1144,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
'error': error_msg,
|
||||
}, status=500)
|
||||
except error.MemberAlreadyInvitedToCircle:
|
||||
error_msg = 'User `{email}` already invited to `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` already invited to `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1174,7 +1174,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
bs.me_decline_circle_invite(circle, send_events=False)
|
||||
backend.loop.create_task(_dispatch_circle_invite_status(backend, user, circle, False))
|
||||
except error.MemberNotInCircle:
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` does not have membership in `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1182,7 +1182,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
'error': error_msg,
|
||||
}, status=500)
|
||||
except error.MemberAlreadyInCircle:
|
||||
error_msg = 'User `{email}` already accepted in `Circle`'.format(email=head.email)
|
||||
error_msg = 'User `{email}` already accepted in `Circle`'.format(email=backend.util_get_display_email(head))
|
||||
return render(req, 'msn:abservice/ManageWLConnectionResponse.xml', {
|
||||
'cachekey': cachekey,
|
||||
'host': settings.ADDRESSBOOK_HOST,
|
||||
@@ -1210,7 +1210,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
add_ctc = True
|
||||
if add_ctc:
|
||||
try:
|
||||
bs.me_contact_add(contact_uuid, models.ContactList.FL, name=head.email)
|
||||
bs.me_contact_add(contact_uuid, models.ContactList.FL, name=backend.util_get_display_email(head))
|
||||
except error.ContactListIsFull:
|
||||
return schema_fault(req, 'http://www.msn.com/webservices/AddressBook/ManageWLConnection', 'Contact list is full')
|
||||
except:
|
||||
@@ -1237,7 +1237,7 @@ def ab_ManageWLConnection(req: web.Request, header: Any, action: Any, bs: Backen
|
||||
'now': now_str,
|
||||
'user': user,
|
||||
})
|
||||
|
||||
|
||||
def ab_BreakConnection(req: web.Request, header: Any, action: Any, bs: BackendSession) -> web.Response:
|
||||
backend: Backend = req.app['backend']
|
||||
cachekey = secrets.token_urlsafe(172)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
{% if ctc.detail.last_name %}
|
||||
<lastName>{{ ctc.detail.last_name }}</lastName>
|
||||
{% endif %}
|
||||
<passportName>{{ ctc.head.email }}</passportName>
|
||||
<passportName>{{ display_email(ctc.head) }}</passportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<displayName>{{ ctc.status.name }}</displayName>
|
||||
<puid>{{ puid_format(ctc.head.uuid) }}</puid>
|
||||
@@ -198,7 +198,7 @@
|
||||
</annotations>
|
||||
<contactType>Me</contactType>
|
||||
<quickName>{{ user.status.name }}</quickName>
|
||||
<passportName>{{ user.email }}</passportName>
|
||||
<passportName>{{ display_email(user) }}</passportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<displayName>{{ user.status.name }}</displayName>
|
||||
<puid>{{ puid_format(user.uuid) }}</puid>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<abInfo>
|
||||
<ownerPuid>0</ownerPuid>
|
||||
<OwnerCID>{{ cid_format(user.uuid, decimal = True) }}</OwnerCID>
|
||||
<ownerEmail>{{ user.email }}</ownerEmail>
|
||||
<ownerEmail>{{ display_email(user) }}</ownerEmail>
|
||||
<fDefault>true</fDefault>
|
||||
<joinedNamespace>false</joinedNamespace>
|
||||
<IsBot>false</IsBot>
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
<abInfo>
|
||||
<ownerPuid>0</ownerPuid>
|
||||
<OwnerCID>{% if ab_id.startswith('00000000-0000-0000-0009-') %}{{ cid_format(ab_id, decimal = True) }}{% else %}{{ cid_format(user.uuid, decimal = True) }}{% endif %}</OwnerCID>
|
||||
<ownerEmail>{% if ab_id.startswith('00000000-0000-0000-0009-') %}{{ ab_id }}@live.com{% else %}{{ user.email }}{% endif %}</ownerEmail>
|
||||
<ownerEmail>{% if ab_id.startswith('00000000-0000-0000-0009-') %}{{ ab_id }}@live.com{% else %}{{ display_email(user) }}{% endif %}</ownerEmail>
|
||||
<fDefault>true</fDefault>
|
||||
<joinedNamespace>false</joinedNamespace>
|
||||
<IsBot>false</IsBot>
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<contactId>{{ head.uuid }}</contactId>
|
||||
<contactInfo>
|
||||
<contactType>LivePending</contactType>
|
||||
<quickName>{{ head.email }}</quickName>
|
||||
<passportName>{{ head.email }}</passportName>
|
||||
<quickName>{{ display_email(head) }}</quickName>
|
||||
<passportName>{{ display_email(head) }}</passportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<displayName>{{ head.email }}</displayName>
|
||||
<displayName>{{ display_email(head) }}</displayName>
|
||||
<puid>{{ puid_format(user.uuid) }}</puid>
|
||||
<CID>{{ cid_format(head.uuid, decimal = True) }}</CID>
|
||||
<IsNotMobileVisible>false</IsNotMobileVisible>
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
<contactId>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}00000000-0000-0000-0009-{{ circle.chat_id }}{% else %}{{ head.uuid }}{% endif %}</contactId>
|
||||
<contactInfo>
|
||||
<contactType>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}Circle{% elif circle is not none %}{% if circle.memberships[head.uuid].state == CircleState.WaitingResponse or circle.memberships[head.uuid].state == CircleState.Rejected or (circle.memberships[head.uuid].role == CircleRole.Empty or circle.memberships[head.uuid].state == CircleState.Empty) %}LivePending{% else %}Live{% endif %}{% else %}Live{% endif %}</contactType>
|
||||
<quickName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}circle{% else %}{{ head.email }}{% endif %}</quickName>
|
||||
<passportName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}00000000-0000-0000-0009-{{ circle.chat_id.upper() }}@hotmail.com{% else %}{{ head.email }}{% endif %}</passportName>
|
||||
<quickName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}circle{% else %}{{ display_email(head) }}{% endif %}</quickName>
|
||||
<passportName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}00000000-0000-0000-0009-{{ circle.chat_id.upper() }}@hotmail.com{% else %}{{ display_email(head) }}{% endif %}</passportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<displayName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}{{ circle.name }}{% else %}{{ head.email }}{% endif %}</displayName>
|
||||
<displayName>{% if circle is not none and ab_id == '00000000-0000-0000-0000-000000000000' %}{{ circle.name }}{% else %}{{ display_email(head) }}{% endif %}</displayName>
|
||||
<puid>{{ puid_format(user.uuid) }}</puid>
|
||||
<CID>{% if circle is not none %}{{ cid_format('00000000-0000-0000-0009-' + circle.chat_id, decimal = True) }}{% else %}{{ cid_format(head.uuid, decimal = True) }}{% endif %}</CID>
|
||||
<IsNotMobileVisible>false</IsNotMobileVisible>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<JoinedDate>{{ date_format(contact.head.date_created) }}</JoinedDate>
|
||||
<ExpirationDate>0001-01-01T00:00:00</ExpirationDate>
|
||||
<Changes />
|
||||
<PassportName>{{ contact.head.email }}</PassportName>
|
||||
<PassportName>{{ display_email(contact.head) }}</PassportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<PassportId>0</PassportId>
|
||||
<CID>{{ cid_format(contact.head.uuid, decimal = True) }}</CID>
|
||||
@@ -74,7 +74,7 @@
|
||||
<JoinedDate>{{ date_format(contact.head.date_created) }}</JoinedDate>
|
||||
<ExpirationDate>0001-01-01T00:00:00</ExpirationDate>
|
||||
<Changes />
|
||||
<PassportName>{{ contact.head.email }}</PassportName>
|
||||
<PassportName>{{ display_email(contact.head) }}</PassportName>
|
||||
<IsPassportNameHidden>false</IsPassportNameHidden>
|
||||
<PassportId>0</PassportId>
|
||||
<CID>{{ cid_format(contact.head.uuid, decimal = True) }}</CID>
|
||||
@@ -111,7 +111,7 @@
|
||||
</Handle>
|
||||
<CreatorPuid>0</CreatorPuid>
|
||||
<CreatorCID>{{ cid_format(user.uuid, decimal = True) }}</CreatorCID>
|
||||
<CreatorPassportName>{{ user.email }}</CreatorPassportName>
|
||||
<CreatorPassportName>{{ display_email(user) }}</CreatorPassportName>
|
||||
<CircleAttributes>
|
||||
<IsPresenceEnabled>false</IsPresenceEnabled>
|
||||
<Domain>WindowsLive</Domain>
|
||||
|
||||
+16
-1
@@ -11,7 +11,11 @@ def render(req: web.Request, tmpl_name: str, ctxt: Optional[Dict[str, Any]] = No
|
||||
else:
|
||||
content_type = 'text/html'
|
||||
tmpl = req.app['jinja_env'].get_template(tmpl_name)
|
||||
content = tmpl.render(**(ctxt or {}))
|
||||
template_context = dict(ctxt or {})
|
||||
backend = req.app.get('backend')
|
||||
if backend is not None:
|
||||
template_context['display_email'] = display_email
|
||||
content = tmpl.render(**template_context)
|
||||
return web.Response(status = status, content_type = content_type, text = content)
|
||||
|
||||
async def preprocess_soap(req: web.Request) -> Tuple[Any, Any, Optional[BackendSession], str]:
|
||||
@@ -151,6 +155,17 @@ def parse_cookies(cookie_string: Optional[str]) -> Dict[str, Any]:
|
||||
|
||||
return cookie_dict
|
||||
|
||||
def display_email(user: Any, fallback: Optional[str] = None) -> str:
|
||||
if isinstance(user, str):
|
||||
user = backend.user_service.get(user)
|
||||
if user is None and fallback:
|
||||
uuid = backend.user_service.get_uuid(fallback)
|
||||
if uuid is not None:
|
||||
user = backend.user_service.get(uuid)
|
||||
if user is None:
|
||||
return fallback or ''
|
||||
return backend.util_get_display_email(user)
|
||||
|
||||
async def dispatch_abch(req: web.Request, module: Any, prefix: str) -> web.Response:
|
||||
header, action, bs, _ = await preprocess_soap(req)
|
||||
if bs is None:
|
||||
|
||||
Reference in new issue
Block a user