mchat | Simple chat system that can do file transfers | Websocket library

 by   spawnfest JavaScript Version: Current License: No License

kandi X-RAY | mchat Summary

kandi X-RAY | mchat Summary

mchat is a JavaScript library typically used in Networking, Websocket applications. mchat has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Simple chat system that can do file transfers over websockets :) - However file transfers work only in chrome browsers :( - Made possible by Erlang, Cowboy and Web Workers with Binary WebSockets.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mchat has a low active ecosystem.
              It has 7 star(s) with 3 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              mchat has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mchat is current.

            kandi-Quality Quality

              mchat has no bugs reported.

            kandi-Security Security

              mchat has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              mchat does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              mchat releases are not available. You will need to build from source code and install.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mchat
            Get all kandi verified functions for this library.

            mchat Key Features

            No Key Features are available at this moment for mchat.

            mchat Examples and Code Snippets

            No Code Snippets are available at this moment for mchat.

            Community Discussions

            QUESTION

            Unable to show the message list in left and right side of the chat room, always showing all the message in left side(receiver side)
            Asked 2021-Mar-01 at 14:22

            I am using recyclerview to show all my message in my app. But it always showing the messages in the left side of the chat room.

            How can I achieve this?

            This is my code:

            Here my adapter always goes to the else part and listing all the message in the left side of the screen(i.e) other user messages

            Sample image

            Adapter:

            ...

            ANSWER

            Answered 2021-Mar-01 at 14:22

            you are checking your viewType twice. you should not check it again in onCreateViewHolder.

            try something like this:

            Source https://stackoverflow.com/questions/66422788

            QUESTION

            NullPointerException on RecyclerView, there is no id mistake
            Asked 2021-Feb-07 at 16:01

            I have checked several times the name of my layout RecyclerView as I show on other StackOverflow questions but it is correct. The error of the logcat is this:

            ...

            ANSWER

            Answered 2021-Feb-07 at 16:01

            You call findViewById() here:

            Source https://stackoverflow.com/questions/66089726

            QUESTION

            Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference (MessageActivity.java:150)
            Asked 2021-Jan-26 at 18:15
            public class MessageActivity extends AppCompatActivity {
            
                TextView username;
                ImageView imageView;
                RecyclerView recyclerViewy;
                EditText msg_editText;
                ImageButton sendBtn;
            
            
                FirebaseUser fuser;
                DatabaseReference references;
                Intent intent;
            
                MessageAdapter messageAdapter;
                Listmchat;
                RecyclerView recyclerView;
            
            
                @Override
                 protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_message);
            
                    imageView = findViewById(R.id.imageview_profile);
                    username = findViewById(R.id.usernamey);
                    sendBtn = findViewById(R.id.btn_send);
                    msg_editText = findViewById(R.id.text_send);
                    recyclerView = findViewById(R.id.recycler_view);
            
            
            
            
                    recyclerView.setHasFixedSize(true);
            
            
                    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
                    linearLayoutManager.setStackFromEnd(true);
                    recyclerView.setLayoutManager(linearLayoutManager);
            
            
                    intent = getIntent();
                    String userid = intent.getStringExtra("userid");
            
                    fuser = FirebaseAuth.getInstance().getCurrentUser();
                    references = FirebaseDatabase.getInstance().getReference("MyUsers").child(userid);
            
                    references.addValueEventListener(new ValueEventListener() {
                        @Override
                        public void onDataChange(@NonNull DataSnapshot snapshot) {
                            Users users = snapshot.getValue(Users.class);
                            username.setText(users.getUsername());
            
                            if (users.getImageURL().equals("default")){
                                imageView.setImageResource(R.mipmap.ic_launcher);
            
                            }else {
                                Glide.with(MessageActivity.this)
                                        .load(users.getImageURL())
                                        .into(imageView);
                            }
            
            
                            readMessages(fuser.getUid(),userid,users.getImageURL());
            
                        }
            
                        @Override
                        public void onCancelled(@NonNull DatabaseError error) {
            
                        }
                    });
            
                    sendBtn.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            String msg = msg_editText.getText().toString();
            
                            if (!msg .equals("")){
                                sendMessage(fuser.getUid(),userid,msg);
                            }else {
                                Toast.makeText(MessageActivity.this, "please send a non empty message !", Toast.LENGTH_SHORT).show();
                            }
                            msg_editText.setText("");
            
            
                        }
                    });
            
            
            
            
                }
            
                 private void sendMessage(String sender,String receiver ,String message){
                    DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
            
                    HashMap hashMap =new HashMap<>();
                    hashMap.put("sender",sender);
                    hashMap.put("receiver",receiver);
                    hashMap.put("message",message);
            
                    reference.child("Chats").push().setValue(hashMap);
                }
            
            
                 private void readMessages(String myid,String userid,String imgurl){
                   mchat = new ArrayList<>();
                   references = FirebaseDatabase.getInstance().getReference("Chats");
            
                   references.addValueEventListener(new ValueEventListener() {
                       @Override
                       public void onDataChange(@NonNull DataSnapshot snapshot) {
                           mchat.clear();
                           for (DataSnapshot dataSnapshot :snapshot.getChildren()){
            
                               Chat chat = dataSnapshot.getValue(Chat.class);
            
                               if (chat.getReceiver().equals(myid)&&chat.getSender().equals(userid)&&chat.getReceiver().equals(userid)&&chat.getSender().equals(myid)){
                                   mchat.add(chat);
                               }
                               messageAdapter = new MessageAdapter(MessageActivity.this,mchat,imgurl);
                               recyclerView.setAdapter(messageAdapter);
                           }
            
                       }
            
                       @Override
                       public void onCancelled(@NonNull DatabaseError error) {
            
                       }
                   });
            
            
                }
               }
            
            ...

            ANSWER

            Answered 2021-Jan-26 at 15:28

            It looks like users.getImageURL() is returning null for one or more of your nodes. If this is indeed a common occurrence in your database, you can easily detect by using so-called Yoda-notation for your check:

            Source https://stackoverflow.com/questions/65903422

            QUESTION

            How to display sender name in group chat
            Asked 2020-Nov-12 at 05:00

            I am working on a chat app for android with firebase. so i want to show the sender name above of the first message from same sender but i get the sender name on every message sent by the sender,

            sender name bug image

            the logic i am using

            ...

            ANSWER

            Answered 2020-Nov-11 at 09:48

            @mr. groot was working on a similar app and achived this on my RecyclerView onBind method

            Source https://stackoverflow.com/questions/64783084

            QUESTION

            I am having a two null pointer Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setHasFixedSize(boolean)
            Asked 2020-Oct-13 at 20:27

            I am having a null pointer of, Is Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setHasFixedSize(boolean)' on a null object reference I am having problems with my recyclerView Here is my log cat Please help

            ...

            ANSWER

            Answered 2020-Oct-13 at 20:17

            The problem is on the XML file I did not indicate the id on the recyclerview

            Source https://stackoverflow.com/questions/64342218

            QUESTION

            Firestore chat messages are not in the right order?
            Asked 2020-Aug-11 at 13:10

            So, I'm still a newbie in Firebase and I'm just switching from the Firebase Realtime Database to Firestore. This has worked out well so far. But I have a problem with the messages from my chat app. With the Firebase Realtime Database everything worked fine, but with Firestore there are some problems. I can send and display the messages, but Firestore somehow changes the order of the chat. Could someone explain this to me and suggest a solution?

            Example video of the bug: https://youtu.be/KE28qK22DoQ

            (Adapter) MessageAdapter: https://hastebin.com/avoluximow.java

            (Model) Chat: https://hastebin.com/secuvojoyu.java

            This is my code for writing and reading the data:

            ...

            ANSWER

            Answered 2020-Aug-11 at 13:10

            Try to add new field (when sending message):

            chat.put("created", Timestamp.now());

            And add field to your entity Chat.java:

            Source https://stackoverflow.com/questions/63344331

            QUESTION

            how to add UIView with code? Without using storyboard
            Asked 2020-Jul-19 at 15:23

            I am a beginner and am only able to add elements via storyboard.

            Now I would like to know how to add UIView code to the screen without using a storyboard.

            I need to place it at the very top, full width of the screen, replacing the NavigationBar with a UIView

            ...

            ANSWER

            Answered 2020-Jul-19 at 15:23

            Here is how you can place it over entire screen

            Source https://stackoverflow.com/questions/62982120

            QUESTION

            Recyclerview not updating after activity restart
            Asked 2020-Jun-18 at 09:54

            So, I'm not sure about the title of this question but here it goes. I have a recyclerview for my chat room. The first time the activity started it has no problem displaying the messages but after pressing the back button back to the main activity showing all chat rooms then click the same chat room again it displays nothing. Then, after sent a message it can display all the messages again. I'm not sure what happened, help, please. Oh, I already tried a few things and browse the internet but because I'm not sure what the keyword is, so I'm quite stuck now

            Okay, here is the thing

            First main activity, (ignore the other 2 tabs, it's empty)

            Main Activity

            Then open a chat room

            First time open chat room fine

            Then press back button, back to MainActivity, then open the same room and no chat displayed

            chat room not displaying anything

            Then it displays messages again after sending a new messages

            new message

            I have tried to place notifyDataSetChanged() on various event like onStart, onCreate etc but nothing works;

            here is my chat activity

            ...

            ANSWER

            Answered 2020-Jun-18 at 07:27

            in my case i used onResume()

            Source https://stackoverflow.com/questions/62444291

            QUESTION

            How do i select multiple items in Recyclerview with contextual Action Bar
            Asked 2020-May-03 at 13:20

            I am trying select multiple items from recyclerview using a contextual action bar my contextual action bar inflates correctly but i am having problems while selecting multiple items at once. I want to select multiple items and perform actions collectively on them

            My code

            ActionModeCallback

            ...

            ANSWER

            Answered 2020-May-03 at 13:20

            There is solution useful solution for selecting multiple items in recyclerView.

            How to implement multi-select in RecyclerView?

            Source https://stackoverflow.com/questions/61573706

            QUESTION

            How to show if a message is seen or not via using Firebase Real time Database
            Asked 2020-Apr-28 at 17:39

            I want to show if a message is seen or not in my app which is using Firebase Real time Database.What i am able to till now is update it on on the database if the message is seen or not but i am not able to retrieve that value using listeners in my recyclerview Adaptor .It happens that if the last message is not seen it displays all the previous messages are not seen similarly if the last message is seen it displays all the previous messages are seen.

            Database Structure

            My Code for checking if the message is seen or not

            ...

            ANSWER

            Answered 2020-Apr-28 at 17:39

            Do this in onBindViewHolder

            Source https://stackoverflow.com/questions/61483623

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mchat

            Assuming you have rebar install just run: <pre>make</pre>.

            Support

            Testing over local network i.e. not "localhost" - Get precondition failed errors on loading files from server the first time. - Hence had to reload or retry certain features twice before resources were loaded.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/spawnfest/mchat.git

          • CLI

            gh repo clone spawnfest/mchat

          • sshUrl

            git@github.com:spawnfest/mchat.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Websocket Libraries

            netty

            by netty

            ws

            by websockets

            websocket

            by gorilla

            websocketd

            by joewalnes

            koel

            by koel

            Try Top Libraries by spawnfest

            NEPI_2019

            by spawnfestJavaScript

            perforator2

            by spawnfestJavaScript

            Cloudanators

            by spawnfestC

            spawnfest.github.io

            by spawnfestHTML

            boxerboyapp

            by spawnfestCSS