Skip to content

LeyaoW/Chat-Bubble

Repository files navigation

Chat Bubble

The zip contains three types of files: the dsu file, the PDOC files, and the python file.

The dsu files are chat history stored to use when the Internet does not work. They are named in the format "sender_TO_recipient" These files are generated by the retrieve_all function automatically when the program is opened, as long as the Internet works.

The python files contain all the code needed for the program to function: two GUI files to send messages to each other, one ds_messenger, and one ds_protocol it imports, each followed by a testing python file.

We are showing our ds_messenger.py and ds_protocal.py using the PDOC. Our file can be successfully opened with Chrome, but if you open it with the firefox, sometimes errors happen.


The two GUI files are highly identical, except that there have different default values for the username and password so that they can send messages to each other.

  • gui_wobuzhidao.py: This file has a default account named 'wobuzhidao' to send messages.

  • gui_leyaow123.py: Likewise, this file has a default account named leyaow123' to send messages.

  • ds_messenger.py: This python file contains the code of the DirectMessage class and DirectMessager class. The DirectMessage class is used to store all the information in a message, including the sender, recipient, entry and time. The DirectMessage includes all the attributes and functions used to send the message, including the dsuserver, the username, the password, and functions like 'send' or 'join'.

*ds_protocol.py: This function helps to wrap up the message we need to send in a string of json format for the server to recognize.

*test_ds_messenger.py: The module contains the unitest class for the python file ds_messenger.py. *test_ds_protocol.py: The module contains the unitest class for the python file ds_protocol.py.


How our GUI works:

If the Internet works, the program is supposed to be open with the history of chats automatically. A list of contacts' names will appear on the left side of treeview. As you click on the user's name, the chat history will appear.

However, if we are disconnected, you need to input the contact name using 'Add User' button. If there are chat histoires stored locally, the program will be able to display the chat histories.


How our program FLOURISH

  1. The text in the display box is changed into green.

  2. We add a feature to allow users to change the account by inputting the new username and password.

On the top of the interface, there's a menu laber called 'settings'. As you click that label, the 'Change the Account' will appear. Click on this one and you will have windows to input the username and password. However, if the username or the password is invalid, the program will not be able to connect to the server successfully so there will be a message box showing that there's an error.

As you input a valid account, the interface will be reset with the new chat histories retrieved by this account's username and password.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages