Commit Graph
14 Commits
Author SHA1 Message Date
Didier (did) 8fa2a6fe11 [IMP] mail: search a discuss thread
See https://github.com/odoo/enterprise/pull/43980

task-2359037

closes odoo/odoo#118794

Related: odoo/enterprise#43980
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-03 19:19:50 +00:00
Alexandre Kühn 22ed4ec268 [REF] mail: rename commands in discuss model data
Relational data in server formatter are:
- for one relation: None/false or object
- for many relations: list of objects or list of commands

The commands were:
- 'insert': to add a new item in a relational field
- 'unlink': to remove an item from a relational field
- 'insert-and-unlink': to remove an item from a relational field
- 'clear': to remove all items from relational field

There was a slight nuance between 'unlink' and 'insert-and-unlink'
at some point, but it becomes irrelevant with current code of model.
The name of the commands were hard to grasp what they actually mean
for the many relations.

This commit improves it by renaming 'insert' by 'ADD' and the 2
'unlink' commands by 'DELETE'. This makes it more apparent that
the data in 'ADD' refers to data of record to add in the relation,
while 'DELETE' refers to data of record to delete from the relation.
The 'clear' has been replaced by `False` value instead of a command.

Part-of: odoo/odoo#136308
2023-09-27 13:11:58 +00:00
tsm-odoo a188d9c894 [IMP] im_livechat, *: use guests for livechat visitors
*: crm_livechat, mail, test_discuss_full, website_livechat.

part of task-3332628

closes odoo/odoo#129770

Related: odoo/enterprise#45767
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-09-07 13:10:07 +00:00
tsm-odoo 814b26261e [IMP] mail: add attachment panel to discuss
This PR adds a panel to consult all attachments of a discuss channel
easily.

task-3476444

closes odoo/odoo#132784

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-30 13:10:20 +00:00
tsm-odoo cdc35aed74 [IMP] mail: add decorator to extract guest
This PR adds the `add_guest_to_context` decorator in order to provide a generic
way to extract the guest from a request. It will be used to unified guest
extraction from cookie/param based on its provenance (external livechat/public
page).

This is better than the `pre_dispatch` method since it can be applied to
specific routes instead of adding this logic to every request.

part of task-3332628

closes odoo/odoo#130052

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-09 13:20:53 +02:00
Maryam Kia 8d039cafe3 [IMP] mail: Send voice messages in discuss chats and channels
With this commit, users can send voice messages in channels and chat.
There's a new button in composer to record audio from the microphone,
up to 1 minute clip duration. This adds a voice attachment with its
dedicated voice player that shows waveforms and allows playback.

To ensure compatibility in all supported browsers, we choose to
encode voice recording with `audio/mp3` thanks to lib `lamejs`.

Task-3240168

closes odoo/odoo#117036

Related: odoo/enterprise#45482
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-08-09 13:20:46 +02:00
tsm-odoo f5442e970a [IMP] mail: add guest to context when available
This PR prepares the ground for the one introducing guests
for livechat visitors. Since our SameSite cookie policy
is Lax, the cookie won't be send on unsafe cross site
requests thus another mechanism will be introduced to
retrieve the guest.

This PR abstracts the way the guest is retrieved in order
to ease this transition as much as possible by overriding
the `ir_http._pre_dispatch` method in order to inject the
guest in the context if any.

part of task-3332628

closes odoo/odoo#129039

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-25 17:35:40 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
Didier (did)andBrieuc-brd 771477b9a7 [IMP] mail: Introduce gif picker in Discuss
This commit adds a GIF picker in discuss
app. GIF feature makes use of Tenor GIF API [1].
To enable GIF picker in discuss, you must provide
a Tenor GIF API key in the General Settings.
Then the GIF picker is visible in all channels
(chat window and discuss app), next to the emoji picker
button.

[1] https://tenor.com/gifapi/documentation

task-2365705

closes odoo/odoo#116060

Related: odoo/enterprise#41959
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
2023-06-30 23:38:01 +02:00
tsm-odoo 5c12a8b82e [FIX] mail: load after message order
In [1] the order by `id ASC` has been removed from the
`_message_fetch` method. This is wrong since we want
to load the messages coming DIRECTLY after the given
id thus, this order is required.

In order to solve this issue, this commit ensures the
order of the messages returned by the `_message_fetch`
method is always in descending order as it was done
implicitly before [2].

[1]: https://github.com/odoo/odoo/pull/123664
[2]: https://github.com/odoo/odoo/pull/116666

task-3349175

closes odoo/odoo#124169

X-original-commit: 074a5fea5a7f08c7018620cb9b2b956b3a871344
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-06-12 14:03:53 +02:00
tsm-odoo 1fed41319e [FIX] mail: wrong discuss subfolder import in tests
Since [1] the pyhton discuss tests have been splitted into a
subfolder. They are wrongly immported and cannot be run at the
moment. This commit solves this issue.

[1]: https://github.com/odoo/odoo/pull/120062

closes odoo/odoo#124114

X-original-commit: b796704408d0511af2c310fde5964003dc25190e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-07 14:43:27 +02:00
Alexandre Kühn 11b4355a7b [FIX] mail: several discuss improvements (following MILK redesign)
closes odoo/odoo#121948

Forward-port-of: #121683
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-22 16:30:12 +02:00
Zelong Lin ff122ac7ae [IMP] mail: avatar edit in channel and group
1. Display avatar in top bar next to channel name and description.
2. Edit icon appears on hover.
3. Clicking on the Edit icon opens file browser to upload a new avatar.
4. Certain file types are allowed.
5. Avatar can only be changed for group chat by any member of the channel.
6. For channel it can be done with admin rights.
7. Disable uploading text from file uploader in this case.

Also show avatar of channel/chat conversation in chat window.
Author avatar in message list no longer shown im status.
Chat window header color matches new systray color.

task-2684679

[FIX] mail: make chat window header match systray color

Part-of: odoo/odoo#117357
2023-05-16 14:42:05 +02:00
Sébastien Theys ad58e0fdd8 [REF] mail: move discuss.channel code to its own folder (controllers)
This commit focuses on removing all references to discuss.channel from
controllers of mail module.

In preparation of splitting discuss and mail modules.

Part of task-3265211

closes odoo/odoo#119523

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-27 06:10:02 +02:00