Giter VIP home page Giter VIP logo

chatter's People

Contributors

dibs-devs avatar ishtiaque06 avatar kkruto avatar naveenslog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatter's Issues

shortUUID bug in models.py

In chat/models.py, the Room's id is defaulted to shortuuid.ShortUUID.random(length=22). Should be shortuuid.ShortUUID().random.

Immediately direct to the latest chat on homepage access

The problem: right now, the chatter homepage shows a generic webpage containing a list of all the rooms and a "Select a room to get started" message. However, to reflect how chat interfaces usually work, chatter should redirect users to the latest chat that's been active.

The solution: When a user hits the index view, decide if the user has any rooms they belong to. If so, return the chatroom view with the UUID of the latest room.

Scalability concern: Context processor

If a developer is using the context_processors.py provided by Chatter, it loads the list of all rooms a logged in user belongs to with every request. This can lead to additional overhead on page load and database querying, which may not be something that all developers want. This would only be relevant if the developer wants chat features on every page.

First stab: make the list of rooms available in the chatroom and index views as well as in the context_processor so that the developer can choose which one to use depending on the implementation they want.

"User is typing..." message

When a user starts typing on the chat, show that update to the other user(s) that are online in the chatroom.

This can be done by sending a message down the chatSocket.js object and echoing it out on the other end. Since each message sent through chatSocket object has an associated message_type string, this can be used to filter what type of message is being sent to the channels consumer for it to process and echo it back into the channel layer.

Signals for parent apps to use

When it comes to real-time chatting, along comes the idea of real-time notifications as well. On the chatter level, this would involve notifying the app that's using chatter of a new message sent in the system by a user, so that if the parent app wants, it can use the signal to send a notification to the user using the app.

Infinite scroll on chatroom list

Since on first load, chatter only loads the latest 10 chatrooms, allowing an infinite scroll functionality would be great to have.

Let parent app users define a base.html file for chatter to inherit from

The problem: When chatter is being used by a different app as a reusable package, there needs to be a way for the developer to specify which base template they want chatter templates to inherit from. For example, developers might want a unique HTML header navbar on top of chatter. In this scenario, they will end up needing to copy and paste whole existing chatter templates just to add that navbar which appears all throughout their application.

The solution: Give developers an option to specify a base template chatter can inherit from. This can be specified in their app's settings.py file as CHATTER_BASE_TEMPLATE. When this variable is specified, chatter will sit inside the wrapped template provided by the parent application. Otherwise, it will just use the usual base.html template.

No module named 'django_chatter.context_processors'

I was really excited to see this package but this didn't worked for me. I followed all the basic steps in read me. And when i hit runserver and moved to http://127.0.0.1:8000/chat . This show me an error :-

`ModuleNotFoundError at /chat/chat/2432b838-e7a2-4913-9c4e-b3bb61023fde/
No module named 'django_chatter.context_processors'

**`ModuleNotFoundError at /chat/chat/2432b838-e7a2-4913-9c4e-b3bb61023fde/
No module named 'django_chatter.context_processors'**

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/chat/chat/2432b838-e7a2-4913-9c4e-b3bb61023fde/

Django Version: 2.2.10
Python Version: 3.7.4
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'messaging',
 'rest_framework',
 'django_chatter']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "D:\Anaconda\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "D:\Anaconda\lib\site-packages\django\core\handlers\base.py" in _get_response
  145.                 response = self.process_exception_by_middleware(e, request)

File "D:\Anaconda\lib\site-packages\django\core\handlers\base.py" in _get_response
  143.                 response = response.render()

File "D:\Anaconda\lib\site-packages\django\template\response.py" in render
  106.             self.content = self.rendered_content

File "D:\Anaconda\lib\site-packages\django\template\response.py" in rendered_content
  83.         content = template.render(context, self._request)

File "D:\Anaconda\lib\site-packages\django\template\backends\django.py" in render
  61.             return self.template.render(context)

File "D:\Anaconda\lib\site-packages\django\template\base.py" in render
  169.                 with context.bind_template(self):

File "D:\Anaconda\lib\contextlib.py" in __enter__
  112.             return next(self.gen)

File "D:\Anaconda\lib\site-packages\django\template\context.py" in bind_template
  242.         processors = (template.engine.template_context_processors +

File "D:\Anaconda\lib\site-packages\django\utils\functional.py" in __get__
  80.         res = instance.__dict__[self.name] = self.func(instance)

File "D:\Anaconda\lib\site-packages\django\template\engine.py" in template_context_processors
  85.         return tuple(import_string(path) for path in context_processors)

File "D:\Anaconda\lib\site-packages\django\template\engine.py" in <genexpr>
  85.         return tuple(import_string(path) for path in context_processors)

File "D:\Anaconda\lib\site-packages\django\utils\module_loading.py" in import_string
  17.     module = import_module(module_path)

File "D:\Anaconda\lib\importlib\__init__.py" in import_module
  127.     return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>" in _gcd_import
  1006. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load
  983. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
  965. <source code not available>

Exception Type: ModuleNotFoundError at /chat/chat/2432b838-e7a2-4913-9c4e-b3bb61023fde/
Exception Value: No module named 'django_chatter.context_processors'`

Please fix it or tell me a temporary solution ASAP.

Multitenancy support for ChatConsumer

For now, ChatConsumer works for databases which don't use multitenancy with django-tenants and/or django-tenants-schemas. This needs to be changed to reflect Dibs' implementation of multitenancy, but will most probably be designed to be used with any multitenant apps.

Conflicting requirements

You require explicit versions of channels and channels-redis, which are incompatible.
It makes this package kind of not installable.

$ cat requirements.in
django-chatter
$ pip-compile --upgrade --no-index --output-file=requirements.txt requirements.in
Could not find a version that matches asgiref~=2.1,~=2.3,~=3.0 (from channels==2.1.7->django-chatter==1.0.7->-r requirements.in (line 1))
Tried: 0.8, 0.9, 0.9.1, 0.10.0, 0.11.0, 0.11.0, 0.11.0, 0.11.1, 0.11.1, 0.11.2, 0.11.2, 0.12.0, 0.12.0, 0.12.1, 0.12.1, 0.13.0, 0.13.0, 0.13.2, 0.13.2, 0.13.3, 0.14.0, 0.14.0, 1.0.0, 1.0    There are incompatible versions in the resolved dependencies:
  asgiref~=2.1 (from channels-redis==2.3.3->django-chatter==1.0.7->-r requirements.in (line 1))
  asgiref~=2.3 (from channels==2.1.7->django-chatter==1.0.7->-r requirements.in (line 1))
  asgiref~=3.0 (from daphne==2.3.0->channels==2.1.7->django-chatter==1.0.7->-r requirements.in (line 1))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.