Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
cd77923c
Commit
cd77923c
authored
Jan 30, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pa message fix. Duplicate removed
parent
89d90dfe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
messaging_extension_action_preview_bot.py
bots/messaging_extension_action_preview_bot.py
+2
-3
camel_case_mixin.py
entities/json/camel_case_mixin.py
+2
-1
pa_message.py
entities/json/pa_message.py
+1
-1
No files found.
bots/messaging_extension_action_preview_bot.py
View file @
cd77923c
...
@@ -107,7 +107,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -107,7 +107,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
if
pa_message
.
content_t_t_l
.
ttl
is
not
None
:
if
pa_message
.
content_t_t_l
.
ttl
is
not
None
:
pa_message
.
content_t_t_l
.
expires
=
(
pa_message
.
content_t_t_l
.
expires
=
(
int
(
datetime
.
utcnow
()
.
timestamp
()
*
1000
)
+
int
(
time
.
time
()
*
1000
)
+
int
(
pa_message
.
content_t_t_l
.
ttl
*
1000
)
int
(
pa_message
.
content_t_t_l
.
ttl
*
1000
)
)
)
...
@@ -117,7 +117,6 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -117,7 +117,6 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
reference
=
await
self
.
cosmos_client
.
get_conversation
(
reference
=
await
self
.
cosmos_client
.
get_conversation
(
pa_message
.
conversation_id
,
pa_message
.
tenant_id
pa_message
.
conversation_id
,
pa_message
.
tenant_id
)
)
await
self
.
cosmos_client
.
create_pa_message
(
pa_message
)
except
ItemNotFound
:
except
ItemNotFound
:
future
.
set_exception
(
ConversationNotFound
(
"not found"
))
future
.
set_exception
(
ConversationNotFound
(
"not found"
))
return
return
...
@@ -173,7 +172,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -173,7 +172,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
if
notification
.
content_t_t_l
.
ttl
is
not
None
:
if
notification
.
content_t_t_l
.
ttl
is
not
None
:
notification
.
content_t_t_l
.
expires
=
(
notification
.
content_t_t_l
.
expires
=
(
int
(
datetime
.
utcnow
()
.
timestamp
()
*
1000
)
+
int
(
time
.
time
()
*
1000
)
+
int
(
notification
.
content_t_t_l
.
ttl
*
1000
)
int
(
notification
.
content_t_t_l
.
ttl
*
1000
)
)
)
...
...
entities/json/camel_case_mixin.py
View file @
cd77923c
""" marshmallow-dataclass need a mixin to work with camel - snake cases """
""" marshmallow-dataclass need a mixin to work with camel - snake cases """
import
uuid
import
uuid
from
datetime
import
datetime
from
datetime
import
datetime
from
time
import
time
import
marshmallow_dataclass
import
marshmallow_dataclass
from
marshmallow
import
pre_load
,
post_dump
,
EXCLUDE
from
marshmallow
import
pre_load
,
post_dump
,
EXCLUDE
...
@@ -14,7 +15,7 @@ def uuid_factory() -> str:
...
@@ -14,7 +15,7 @@ def uuid_factory() -> str:
def
timestamp_factory
()
->
int
:
def
timestamp_factory
()
->
int
:
""" Set current unix timestamp """
""" Set current unix timestamp """
return
int
(
datetime
.
utcnow
()
.
timestamp
()
*
1000
)
return
int
(
time
()
*
1000
)
class
CamelCaseMixin
:
class
CamelCaseMixin
:
...
...
entities/json/pa_message.py
View file @
cd77923c
...
@@ -10,8 +10,8 @@ from entities.json.content_ttl import ContentTTL
...
@@ -10,8 +10,8 @@ from entities.json.content_ttl import ContentTTL
class
PAMessage
(
CamelCaseMixin
):
class
PAMessage
(
CamelCaseMixin
):
""" PA message Schema """
""" PA message Schema """
id
:
Optional
[
str
]
id
:
Optional
[
str
]
message_id
:
Optional
[
str
]
conversation_id
:
str
conversation_id
:
str
tenant_id
:
str
tenant_id
:
str
card
:
Optional
[
Any
]
=
None
card
:
Optional
[
Any
]
=
None
content_t_t_l
:
Optional
[
ContentTTL
]
=
None
content_t_t_l
:
Optional
[
ContentTTL
]
=
None
message_id
:
Optional
[
str
]
=
None
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