Commit Graph
1497 Commits
Author SHA1 Message Date
Aaron Bohy 1ca0e11393 [IMP] mail: context sensitive mention
The mention mechanism of the chat composer first proposes partners that are
registered to the current channel or followers of the current document, then
users, and finally partners.

Also reduces the mention detection delay to 200ms.
2015-10-26 12:12:22 +01:00
Géry Debongnie ccddf7072f [IMP] mail: make the interface usable in mobile mode
The sidebar can be make visible by clicking on a button 'Channels' in
the control panel.
2015-10-22 14:43:14 +02:00
Géry Debongnie e2dc7b27ee [IMP] mail: add link to origin channel from message 2015-10-22 14:43:14 +02:00
Aaron Bohy 1dbeac3e5a [IMP] mail: mention starts detecting from @ 2015-10-22 14:43:14 +02:00
Aaron Bohy cfc18172a5 [IMP] mail: composer: use textarea in client action
... allowing multi-line edition, like in the chatter.

Shortcuts:
	- in the client action: ENTER sends, SHIFT+ENTER goes to newline
	- in the chatter: SHIFT+ENTER sends, ENTER goes to newline

Don't use autosize anymore to resize the textarea according to its content as
it didn't fit well within the flex layout of the client action ('height: auto'
didn't increase the height of the flex-item with 'flex-grow: 0'). We perform
the resizing ourselves instead.
2015-10-22 14:43:13 +02:00
Géry Debongnie 4d54a8c0ff [IMP] mail: various ui improvements
including:
- reset scroll position to bottom when leaving channel
- allow clicking on the avatar image
- hide stars when message is of type notification
- sort channel names
- add # before channel names
- rename Whole company channel in general
- replace \n and \r in messages by <br/>
- lighten the hover color of sidebar items in the client action
- Display @ before mentions
2015-10-22 14:43:13 +02:00
Géry Debongnie 586928356b [IMP] mail: notifies users when someone join/leave a channel 2015-10-22 14:43:13 +02:00
Géry Debongnie 81b7a32a4d [FIX] mail: avoid useless rpc on message rendering 2015-10-22 14:43:02 +02:00
Aaron Bohy fe2c1020d1 [FIX] mail: chatter: undefined context for internal notes
Commit 4f9c9ad adds the context to the RPC call of 'message_post', but the
context was only defined for messages sent, and not for internal notes logged.
This causes a crash when logging a note on a calendar event as its method
'message_post' makes the assumption that it always exists, and tries to access
one of its keys.

opw-652470
Closes #9164
2015-10-21 08:55:31 +02:00
Aaron Bohy be5fc7b1a4 [IMP] mail: redirect to DM on user clicked
When clicking on a partner in the thread of messages, it opens the DM with the
associated user if there is one (and if this user isn't the current user).
Otherwise, or when clicking on a record of any other model, the user is
redirected to that record's form view.

This change required a minor change in chat_manager: create_channel now
returns the created channel, as the client action needs it to switch to it.

Moreover, in the thread, when there is no partner associated with a message
(only an email address), we simply use html's mailto mechanism. This fixes a
bug as we formerly tried to open an unexisting record of res.partner.
2015-10-16 15:52:02 +02:00
Géry Debongnie 6ae0309b99 [FIX] bus,mail,livechat: fix problem with multiple long polls
The bus was allowed to restart polling, client side, to allow the user
to directly receive messages in new channels.  This was only acceptable
as a temporary fix, the correct way to do this is to actually notify the
bus server side. This is even more urgent since the client was allowed
to keep multiple longpolls simultaneously, which degraded the experience
in some cases.
2015-10-16 15:52:01 +02:00
Aaron Bohy 765cfa040d [IMP] mail: client action: sidebar: hide livechat when empty
Channel types that disable the 'add a channel' feature like the livechat are
now only rendered in the sidebar of the client action if there exists at least
one channel of that type.
2015-10-16 15:52:01 +02:00
Géry Debongnie 4884b41f55 [IMP] mail: chat_windows improvements
including:
- larger chat windows
- add a counter for unread messages when the chat window is folded
2015-10-16 15:52:01 +02:00
Aaron Bohy 4c7ab52a67 [IMP] mail: thread: hide avatar, author and date of consecutive messages
... from the same author, written within 1 minute (restricted to comments).

Also:
 - Display stars and needactions on hover only
 - Display the date of messages without avatar and info in the margin on hover
 - Add 'selected' state of messages (mainly for touch screens to replace hover)
 - Fix typo (msg_type -> message_type) on the computation of the avatar url
2015-10-16 15:52:01 +02:00
Aaron Bohy 2dfbaceaec [IMP] mail,im_livechat: client action sidebar: 'unsubcribe' cross
displayed for all channels
2015-10-16 15:52:01 +02:00
Aaron Bohy 6b2250b2d2 [FIX] mail: font-family of notification counter in systray
On firefox, the font-family of the counter was font-awesome instead of Roboto
because the counter was inside the <i> tag on which font-awesome rules applied.
This rev. simply moves the counter out of that <i> tag.
2015-10-16 15:52:01 +02:00
Géry Debongnie b8badd6263 [IMP] mail: various small ui improvements
including:
- decrease vertical spacing between user name and text
- decrease vertical spacing between messages
- align avatar width with first line of message
- bold channels more visible (color is actually white)
- decrease online status icon size and change its color
- hide the DM unpin icon, and show it only when hovering
- the add channel icons are less white
- offline user icon is now white
- the unpin icon is now visible when hovering on user name
- correctly display notifications in inbox
2015-10-16 15:52:00 +02:00
Jérome Maes b1849f532e [FIX] mail : posting message with mention and clickable url
Posting message is done in 'html' since mention add html tag in body. Clickable url is done server to allow link in mail and chat message. Plaintext are transform into html, and html message are simply parsed to transform url into clickable link.
2015-10-07 16:37:11 +02:00
Aaron Bohy 4f9c9adf37 [FIX] mail: chatter: various fixes
- Add recipients as followers, and automatically refresh the follower's list
  (before this rev., one needed to reload the record to see the followes' list
  updated)
- Don't display needactions on chatter's messages
- Simplify buttons of suggested partner's dialog, as it should only offer two
  possibilities: Save or Cancel
- Replace unnecessary t-raw's by t-esc's
2015-10-07 15:09:33 +02:00
Aaron Bohy 8019c89ea8 [IMP] mail: prepare livechat integration
- Extract sub-templates for client action's sidebar to ease the livechat
  integration
- Handle livechat's channel_type and messages in chat manager
- Make scrollBottom work in the frontend
2015-10-06 16:24:28 +02:00
Aaron Bohy 01caecf1c7 [FIX] mail: avoid crash when channels contain special characters 2015-10-06 16:24:24 +02:00
Aaron Bohy aab4ef752e [IMP] mail: thread: parameterize the display of messages' star
To allow hiding it in livechat windows on the website.
2015-10-06 16:24:09 +02:00
Aaron Bohy 212bbf1f7e [FIX] mail: thread: messages' date displayed in browser's timezone 2015-10-06 16:23:56 +02:00
Aaron Bohy 581c38cdca [IMP] mail: new message notifications: display message preview 2015-10-06 16:23:25 +02:00
Jérome Maes 811828c0b8 [FIX] mail : clickable url in mail.message from channel, chat and chatter
html_escape_keep_url is now included in plaintext2html method (since the opposite method html2plaintext transform link tags into simple url text). Force the posted message to be plaintext (adding directly html is not safe), and trim the posted message before submitting it.

The url are now clickable again in chat message, but also in chatter messages !
2015-10-06 09:46:55 +02:00
Jérome Maes 2a676ee11c [FIX] mail : broadcast needaction for concerned partners in particular bus channel
Use the (dbname, 'ir.needaction', partner_id) channel to broadcast needaction to partner. Some message can be needaction, without belonging to a mail channel of the partner. Keep the (dbname, 'res.partner', partner_id) channel for conversation header.
2015-10-06 09:44:51 +02:00
Aaron Bohy c3a5f0fb7b [FIX] mail: client action: channel unsubscribe notification
Correctly display the name of the unsubscribed channel in the notification, not
the name of the channel we switched to afterwards.
2015-10-05 16:37:49 +02:00
Aaron Bohy 435f748410 [FIX] mail: client action: crash on channel unsubscribe
After unsubscribing from a channel, the client action switches to inbox.
Method set_channel() takes as argument the channel to switch to, not its id.
2015-10-05 10:17:53 +02:00
Aaron Bohy de8acb2569 [FIX] mail: emojis: replace all occurences of the emoji in messages
The problem was that, when substituting the emoji pattern by the emoji icon,
we only replaced the first occurence of the pattern.

This rev. replaces all occurences of the pattern by performing a global match
('g' option), and correctly handles matches overlap by using a lookahead
assertion ('x(?=y)') instead of basic non-capturing parentheses ('x(?:y)').
2015-10-02 15:49:37 +02:00
Aaron Bohy 28d3dc6cc9 [IMP] mail: only display needactions in channel inbox 2015-10-02 15:49:37 +02:00
Aaron Bohy 8908d5ccab [IMP] mail: reduce number of lookups in channels dict
Instead of using the channel's ids to communicate between the client action and
the chat manager, directly use the channel itself. This prevents many lookups
in the channels dict to retrieve the channel from its id.
2015-10-02 15:49:36 +02:00
Aaron Bohy 986f449909 [IMP] mail: client action: focus on composer when opening a channel
Disable this feature on mobile as we don't want the mobile composer to open
each time we switch from an channel to an other.
2015-10-02 15:49:10 +02:00
Aaron Bohy 98bd82365c [FIX] mail: fetch channel info on new message notification
When receiving a new message, we add it in the client side cache of the
corresponding channel. The problem was that when we previously unsubscribed
to this channel, it was removed from the cache, producing a traceback when
trying to add the new message.

This rev. checks whether or not the channel is in the cache, and if not,
performs an rpc to fetch its info before adding the message.
2015-10-02 15:49:10 +02:00
Aaron Bohy 8a99491793 [IMP] mail: cache messages for each fetched domain
This is kind of a fix as well as it permits again to use filters on channels.
2015-10-02 15:49:10 +02:00
Aaron Bohy 0d91339b7b [IMP] mail: increase needaction counter on new message notification
At least, when someone mentions a user in a message posted in a channel, a
notification is sent by the server that a new message just arrived in that
channel. Client side, we then decide whether or not this message should appear
in the Inbox as well. In the positive case, we can increase the needaction
counter.

Problem remains for messages sent from chatters and by using the mail icon in
the systray, as for those ones, no notification at all is sent by the server.
2015-10-01 14:00:20 +02:00
Aaron Bohy 0e2dd225f6 [IMP] mail: client_action: sidebar items fine tuning
Mostly, display in bold channels with unread messages
2015-10-01 14:00:20 +02:00
Aaron Bohy 730efcc3df [FIX] mail: mark a message as read should not hide 'load more' button
It was hidding it because the method that removes a message from the thread
didn't pass the options for the thread rendering, and the flag specifiying
whether or not the 'load more' button should be displayed is in this options
object.
2015-10-01 14:00:19 +02:00
Géry Debongnie 6ea633ee62 [FIX] mail: synchronize needaction counter
in systray and in client action.  This is only a client side fix.  A
problem persists: the server does not notify the client when a new
message arrives in the inbox, to the client can not possibly increase
the counter.
2015-10-01 14:00:19 +02:00
Géry Debongnie 2a5f07e0b9 [REF] mail: last part of the chat refactoring (client side)
Removal of old files and update of assets and imports

Joint work with aab
2015-10-01 14:00:18 +02:00
Géry Debongnie 62be162877 [REF] mail: second part of the chat refactoring (client side)
Joint work with aab
2015-10-01 14:00:18 +02:00
Aaron Bohy 512287cac1 [REF] mail: first part of the chat refactoring (client side)
Joint work with ged
2015-10-01 14:00:18 +02:00
Jérome Maes 3304b31938 [FIX] im_livechat, website_mail : message author avatar visible
To display author avatar to public user, using the /web/image url with res.partner returns the placeholder since public doesn't have access. Using the url on mail.message will display the avatar according to the access right defined on res_model/res_id of mail.message. However this executes mush query to fetch the avatar image (1 per message, against 1 per partner).

Maybe this wasn't a bug, but since it is a regression, this deserves to be fixed ...
2015-10-01 12:41:18 +02:00
Thibault Delavallée 486aab5098 [FIX][BACK FROM TRASH] mail: chatter: read more / read less
Read more / less feature is back (and probably ugly). It has probably been
removed when refactoring the old chatter.

[FIX] tools: html shortening: encoding issue
2015-09-24 16:20:53 +02:00
Jérome Maes 59f04dc364 [FIX] mail : '@' mention appears twice when selecting with clicking ENTER.
UP and DOWN (keydown event) move the cursor position at begining and end of the input text value. ENTER keypress event add 1 to the cursor position. So these events are now 'preventDefault'.
2015-09-23 14:35:43 +02:00
Thibault Delavallée a852218759 [FIX] mail: slack: log a note with internal subtype
The subtype id was not correctly computed, leading to all subtypes being notes. This
make the activites feature of CRM crash.
2015-09-22 10:28:01 +02:00
Jérome Maes ba0d2060f8 [FIX] mail : suggested partner check on chatter composer.
Embedded the template core in a 'root widget tag' to make the selector 'this.$('.o_mail_chatter_compose_message_suggested_partners input:checked')'  works.
2015-09-18 11:50:40 +02:00
Jérome Maes 762cc2dbfa [FIX] mail : make follower subtype edition works
On follower list of a document, the user can (if access rights granted) edit the subtype subscription of other follower. This open a modal with checkboxes. This is commit make this feature works and adapt it to channel follower.
2015-09-14 10:16:21 +02:00
Christophe Matthieu a4f041ed45 [FIX] mail: display attachment preview 2015-09-11 11:07:07 +02:00
Yannick Tivisse aedb75081b [IMP] mail: Set the compose message wrapper in odoo_blue color 2015-09-07 18:25:49 +02:00
Jérome Maes 4bdfa3b6ca [IMP] mail : invite follower wizard have 2 appearances
The wizard is the same object, but to add channel as follower, some fields was not required. Via the 'mail_invite_follower_channel_only' context key, the unrelevant fields are hidden.
2015-09-04 15:55:46 +02:00