Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read & Delivered indicator #53

Closed
brizaldi opened this issue Jun 2, 2020 · 17 comments
Closed

Read & Delivered indicator #53

brizaldi opened this issue Jun 2, 2020 · 17 comments
Assignees
Labels
enhancement New feature or request

Comments

@brizaldi
Copy link

brizaldi commented Jun 2, 2020

I think we need to add read & delivered indicator for one-to-one conversations, currently it only shows SendingIndicator

@imtoori imtoori added the enhancement New feature or request label Jun 2, 2020
@imtoori imtoori self-assigned this Jun 2, 2020
@imtoori
Copy link
Contributor

imtoori commented Jun 2, 2020

yes, that's one of the next features to be added

@imtoori
Copy link
Contributor

imtoori commented Jul 6, 2020

hey! the new version has read indicators

however, at the moment our backend does not support delivered indicators

@brizaldi
Copy link
Author

brizaldi commented Jul 7, 2020

is there any example that explain this feature?

@imtoori
Copy link
Contributor

imtoori commented Jul 7, 2020

By default, you should see all the read indicators when available.

You can also override the behaviour passing a MessageBuilder in the MessageListView widget and setting the readList as you prefer.

However, I'll make sure to dedicate a page in the docs for this feature

@brizaldi
Copy link
Author

brizaldi commented Jul 7, 2020

i dont know why but readList is always null, even though the other user already read the chats

@imtoori
Copy link
Contributor

imtoori commented Jul 8, 2020

Is the user in the channel.state.read list?
Note that the user must be a channel member to be included in the list

@brizaldi
Copy link
Author

brizaldi commented Jul 8, 2020

yup, my user is always member of the channel since our app is only using one-to-one conversation

@imtoori
Copy link
Contributor

imtoori commented Jul 8, 2020

Is the user in the channel.state.read list?

what about this?

@brizaldi
Copy link
Author

brizaldi commented Jul 9, 2020

Nevermind, its always null because we didn't put channel.state.read on the readList parameter. Maybe you should put it in the documentation, thanks for responding 👍

@imtoori
Copy link
Contributor

imtoori commented Jul 9, 2020

yes that's what I was saying here

and yes, I'll write some specific doc thanks

@jamesbgl
Copy link

Hi - I am trying to understand if it's possible to hide the read list - I have some chat groups where this is unwieldy, but I cannot find a way to use a custom messageBuilder at the same time as a threadBuilder - seems like if you use threadBuilder then you cannot use a custom messageBuilder in the root level MessageListView.

@xsahil03x
Copy link
Contributor

Hey @jamesbgl, yes currently it's not possible to use threadBuilder if you use a custom message widget. But it's easy enough to open the thread screen by navigating to it. We internally do the same when threadPressed is called

Navigator.push(
          context,
          MaterialPageRoute(builder: (_) {
            return StreamBuilder<Message>(
                stream: streamChannel.channel.state.messagesStream.map(
                    (messages) =>
                        messages.firstWhere((m) => m.id == message.id)),
                initialData: message,
                builder: (_, snapshot) {
				  final parentMessage = snapshot.data;
                  return StreamChannel(
                    channel: streamChannel.channel,
                    child: YourThreadPage(parentMessage),
                  );
                });
          }),
        );

Let us know if you face any problem 😃

@jamesbgl
Copy link

Thanks for the quick reply! my issue is not the thread page, it's the root level that is the problem. I've got 100's of people in my readList and I do not want to show a list of avatars for the users at all. As it stands, the UI overflows and users have to download hundreds of avatar URLs which is slow and inefficient. Makes sense for me to simply not show them at this scale.

My current workaround is fine but I feel it makes sense to be a config setting, I have the message_list_widget.dart imported locally and I set my readList to an empty list. My app is growing quickly so I went with a dirty hack for now.

Mad respect for this plugin!

@imtoori
Copy link
Contributor

imtoori commented Jan 15, 2021

Hey @jamesbgl
What do you think of using the messageBuilder to build the message using our MessageWidget?
Something like this

messageBuilder: (context, messageDetails, messages) {
                    final isMyMessage = messageDetails.isMyMessage;
                    final index = messageDetails.index;
                    final isLastUser = messageDetails.isLastUser;

                    final messageTheme = isMyMessage
                        ? StreamChatTheme.of(context).ownMessageTheme
                        : StreamChatTheme.of(context).otherMessageTheme;
                    return MessageWidget(
                      message: messageDetails.message,
                      messageTheme: messageTheme,
                      reverse: isMyMessage,
                    );
                  },
                )

without passing the readList.

This is just an example, but you can customise it how you want

@jamesbgl
Copy link

jamesbgl commented Jan 15, 2021

I found if I try to have threads, then I cannot provide a custom messagebuilder.

For example, if I uncomment the second line below, then threading functionality is gone completely.

MessageListView(
  //messageBuilder: _messageBuilder,
  threadBuilder: (_, parentMessage) {
    return ThreadPage(
      parent: parentMessage,
    );
  },
)

@imtoori
Copy link
Contributor

imtoori commented Jan 15, 2021

yes, in that case you should use the property onThreadTap of the MessageWidget to navigate to your thread screen

@jamesbgl
Copy link

Got it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants