Code Monkey home page Code Monkey logo

habitica-chat-extension's Introduction

Habitica Build Status Code Climate Bountysource

Habitica is an open-source habit-building program that treats your life like a role-playing game. Level up as you succeed, lose HP as you fail, and earn money to buy weapons and armor.

We need more programmers! Your assistance will be greatly appreciated. The wiki pages below and the additional pages they link to will tell you how to get started on contributing code and where you can go to seek further help or ask questions:

Habitica's code is licensed as described at https://github.com/HabitRPG/habitica/blob/develop/LICENSE

Found a bug? Please report it to admin email rather than creating an issue (an admin will advise you if a new issue is necessary; usually it is not).

Have any questions about Habitica or its community? See the links in the habitica.com website's Help menu or drop in to Guilds > Tavern Chat to ask questions or chat socially!

habitica-chat-extension's People

Stargazers

 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

habitica-chat-extension's Issues

Changing settings doesn't seem to affect the extension

So, since I started work back up on the Chat Extension, I've noticed that changing the settings doesn't seem to be affecting the extension at all. It just keeps using the default settings.

I'm not quite sure why this is yet, but I'll be working on it. I would appreciate any insights people have as to why this might be happening.

Tavern is listed as a guild

For some reason the extension treats the Tavern as a guild. This causes 2 minor issues:

  1. The Tavern is listed both under "Regular Chatrooms" and "Guilds" in the list of groups.
  2. Clicking on the Tavern from the chatbox sends you to it's 'guild page' rather than it's regular page

"Click here to link to your account" has no effect

I installed from the Chrome extensions shop yesterday onto Chrome Version 56.0.2924.87. The extension installed cleanly, but when I click the link "Click here to link to your account," it opens the Habitica API Settings page and has no further effect.

This has persisted through refreshes of the Habitica site and browser restarts.

Firefox bugs: can't copy Username, buttons don't work, CTRL-Enter doesn't send

@Nakonana (33bb14bd-814d-40cb-98a4-7b76a752761c) reported the problems below on
Windows 10, Firefox 74.0. I also see them on Ubuntu 18.04, Firefox 73.01.

"... I can't copy the username by clicking on it, the buttons don't work (copy, delete, report, like, info), CTRL+enter does not send messages...

"I tried reloading the page, disabling avatars, reducing message count limit to 50,12h time format, changing date format, and disabling all my other extensions but nothing changed.

"My extension settings are: use sound, use large text, confirm before deleting messages, minimize group list on load, message count limit = 200, pause chat after 60 minutes, date format: d-mm-yyyy, 24h time if that's of any help"

Chat extension not working: Does not save API token after reload.

Hey,

For a few days I have been having issues with the extension not working. Today in the Tavern, someone else mentioned they had issues as well.

So I investigated it a bit. Turns out that when I select manual setup, my user ID is shown in both the User ID slot and the API key slot. I therefore tried changing it to the API token and reloaded. Then came the pop-up, saying that it was now linked (and the chat module shows up). But.. When I press OK for that pop-up, the website reloads and the whole issue repeats. User ID shown in both User ID and API key slot. I tried a few times, to be sure. Same issue each time.

"Click here to link your account" is not working either (I assume it's the same issue). I'm not sure if it has something to do with the fact that the API token is now "hidden" on the website, and that the extension therefore can't locate it? Just guesses.

For reference, I'm using Google Chrome, version 61.0.3163.100 (Officiel version) (64-bit).

Allow extension to run on domains other than habitica.com

Habitica staff typically use Habitica on a staging site, for the purpose of giving upcoming features and fixes a bit of extra testing before deploying them to production. This extension, however, only displays its chatboxes on habitica.com proper. It'd be nice to have the extension activate on other Habitica domains' tabs, even if it's making requests against the production URL.

The staging site is protected by HTTP Basic Auth, so there's no great concern about non-staff accidentally getting at it via looking at extension options.

Firefox version not approved

The Firefox version of the extension had been rejected and is not available in the marketplace due to the following problems

  1. This version contains minified, concatenated or otherwise machine-generated code. Please provide the original sources, together with instructions on how to generate the final XPI. Source code must be provided as an archive and uploaded using the source code upload field, which can be done during submission or on the version page in the developer hub.
    Please read through the instructions at https://developer.mozilla.org/en-US/Add-ons/Source_Code_Submission.
    Here are some examples that were discovered:
    resources\habitica-markdown.min.js
  1. Please remove all unused permissions from your manifest.
    Here are some examples that were discovered:
    https://ajax.googleapis.com/
  1. Please add a privacy policy to this add-on that details which user data is being sent and to what services. The critical things to describe in the policy are how your extension collects, uses, stores, and shares or discloses information about people.If your add-on makes it apparent to websites that it is installed, this must also be mentioned. The policy should be about the extension only, not a copy of the website's privacy policy. It should also be the actual text, as opposed to a link to a privacy policy on a website. The privacy policy can be added in the add-on settings under “Manage Authors & License” on AMO.
    Here are some examples that were discovered:
    mainChat\chat_inPage.js line 55, 182, 276, 569
  • ^ this one will have to be handled by the Habitica staff
  1. This add-on is creating DOM nodes from HTML strings containing potentially unsanitized data, by assigning to innerHTML, jQuery.html, or through similar means. Aside from being inefficient, this is a major security risk. For more information, see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Safely_inserting_external_content_into_a_page .
    Here are some examples that were discovered:
    mainChat\chat_inPage.js line 147, 194, 199 and possible more.

Ctrl-Enter no longer sends message

Unable to send a message using Ctrl-Enter.
This is an issue for both Chrome and Firefox versions.

(Tested on Chromium Version 83.0.4099.0 and Firefox Version 77.0.1)

Possible related to issue #55 that was recently closed.

Scroll-wheel events passed to window behind when scrolling stops

This is a fairly minor issue, but when I scroll-wheel down to the bottom of a chat window's messages, once I have reached the bottom, scroll events start being passed through to the page behind it, causing it to scroll. Certainly not what I expected, which is that scrolling should've stopped when I reached the bottom.

Similarly, if I'm in the Send window composing a multi-line response and the scroll-bar appears, so long as there are lines above or below to scroll, the scroll-wheel will scroll the response, but as soon as it hits the top or bottom, scroll-wheel events pass to the window behind.

Thanks,
Ben

View player profile when clicking on their avatar.

I hope it's fine to request features here.

Just like how clicking on a player's name in any chat opens their profile. I'd love the extension to have this feature as well. But seeing as clicking their names on the extension adds a @ mention (which is a great feature), I guess clicking on an avatar should show their profile.

Clicking on guild names bring to old urls.

Example, the Book Lust guld has now url https://habitica.com/groups/guild/16b96e1b-0b59-4b49-b9a7-05f20ff760e6, but clicking on the guild name in the extension chat add simply #/options/groups/guilds/16b96e1b-0b59-4b49-b9a7-05f20ff760e6 at the end of current url, and so don't work.

likes count inaccurate (possibly `false` likes are displayed as if they were `true` likes)

Aerilita posted in the Report a Bug guild:
"My post appears void of likes on the website, but with a +1 via the chat extension."
screenshot

I haven't looked at the extension's code, but my guess would be that it's treating false likes in the same way as true ones. I.e., when someone clicks the like button on a post, their plus-one is recorded in the message like this:

{
    "_id": "abcdefg1-2d2f-4f72-8bf6-abcdefgabcde",
    "text": "post goes here",
    "likes": {
        "12345678-6267-4e87-b989-123412345678": true
    },
    ...
}

But if they change their mind and click like again to remove their plus-one, the data in the message changes to this:

{
    "_id": "abcdefg1-2d2f-4f72-8bf6-abcdefgabcde",
    "text": "post goes here",
    "likes": {
        "12345678-6267-4e87-b989-123412345678": false
    },
    ...
}

If the extension is counting items in the likes object without checking if they're true or false, that would explain what Aerlita noticed. I suspect this is what's happening in the extension because exactly that bug appears in a chat tool that I wrote for myself. :)

Avatars not displaying

The avatars don't display at all. You can still click the empty space to visit the player's profile. Uninstalling/reinstalling and clearing cache didn't help.

@mention Suggestions

Hello,

When I hit @, I usually get a dropdown list of people within the group/party that I can choose to @mention. For ex:
image

Could that feature also be available within the chat windows provided by the extension?

Bullet Points can appear weirdly on a separate line

General Info

User Id: bc10ec41-4213-4482-bbb8-558e3c3ea8d5
Opera 43.0.2442.1144
Windows 10 32-bit

Description

Due to Apps, limited ability to process markdown text with bullet points, you are required to put double carriage returns between each point so they appear correctly.

This appears fine in the Habitica Website Chat, however in the chat extension it puts a line break after the
bullet point. See example below:

Text typed

You can use your gold for either :

+ Buying new equipment

+ Items from the Enchanted Armoire 

+ Health potions

+ Party Cards! *Greeting, Thank You, Happy Birthday.*

+ Seasonal Items *These are either extra equipment, seasonal cards, special seeds to throw at your party members* 

+ Some Quest scrolls 

+ Custom rewards. That you decide what you want to buy with your gold! *An hour of TV, that favourite icecream! etc*

Chat Extension rendering:
chaterror_bulletpointdblline

Habitica Website Chat rendering
chaterror_bulletpointdblline_correcthabitica

"Enter" does not send the message

According to the Wiki page, Enter sends the message and Shift+Enter inserts new lines, but both combinations are inserting new lines for me. The only way to send the message is to manually click the "Send" button. Should Enter be sending messages?

Chat freezes Habitica Website & Chat

General Info

User Id: bc10ec41-4213-4482-bbb8-558e3c3ea8d5
Opera 43.0.2442.1144
Windows 10 32-bit

There are reports of this occurring on chrome browsers

Description

Often when opening large guilds like the Tavern, Habitica Help or Report a Bug the chat system freezes. You are unable to interact with either the Chat or Habitica website. Often you are unable to close the tab, and your only options is to kill the browser process.

When it freezes it appears to have loaded the chat correctly, however the Avatar images appear to be still loading. (Only previous avatars appear from previous loaded chat windows).

chaterror

Sometimes, the Avatar images loads successfully, but the icon fails to change from finger pointing to arrow, to allow you to interact with the site. In this instance, you are able to close the browser.

jConsole Error messages

Most of the time there is no-console error messages when the system freezes however occasionally the following messages show.

app-2b1449e3.js:5 GET https://habitica.com/api/v3/members/1ca11363-6e98-41b3-9bab-ecd08a78ea63 404 (Not Found)
send @ app-2b1449e3.js:5
ajax @ app-2b1449e3.js:5
lookUpMember @ chat_inPage.js:358
generateAvatar @ chat_inPage.js:399
digestChatData @ chat_inPage.js:305
success @ chat_inPage.js:178
j @ app-2b1449e3.js:3
fireWith @ app-2b1449e3.js:3
w @ app-2b1449e3.js:5
(anonymous) @ app-2b1449e3.js:5
app-2b1449e3.js:5 GET https://habitica.com/api/v3/members/21612986-ae65-4081-b485-ba1f01004104 404 (Not Found)
send @ app-2b1449e3.js:5
ajax @ app-2b1449e3.js:5
lookUpMember @ chat_inPage.js:358
generateAvatar @ chat_inPage.js:399
digestChatData @ chat_inPage.js:305
success @ chat_inPage.js:178
j @ app-2b1449e3.js:3
fireWith @ app-2b1449e3.js:3
w @ app-2b1449e3.js:5
(anonymous) @ app-2b1449e3.js:5
app-2b1449e3.js:5 GET https://habitica.com/api/v3/members/804a1937-b2eb-4e3f-8d1e-0c0c7e5f6a94 404 (Not Found)
send @ app-2b1449e3.js:5
ajax @ app-2b1449e3.js:5
lookUpMember @ chat_inPage.js:358
generateAvatar @ chat_inPage.js:399
digestChatData @ chat_inPage.js:305
success @ chat_inPage.js:178
j @ app-2b1449e3.js:3
fireWith @ app-2b1449e3.js:3
w @ app-2b1449e3.js:5
(anonymous) @ app-2b1449e3.js:5
app-2b1449e3.js:5 GET https://habitica.com/api/v3/members/cd581a7c-69d6-4f8c-a3b8-3f64e87452b7 404 (Not Found)
send @ app-2b1449e3.js:5
ajax @ app-2b1449e3.js:5
lookUpMember @ chat_inPage.js:358
generateAvatar @ chat_inPage.js:399
digestChatData @ chat_inPage.js:305
success @ chat_inPage.js:178
j @ app-2b1449e3.js:3
fireWith @ app-2b1449e3.js:3
w @ app-2b1449e3.js:5
(anonymous) @ app-2b1449e3.js:5
app-2b1449e3.js:5 GET https://habitica.com/api/v3/members/2b8a3412-fc34-4a11-b58b-154efd924e9e 404 (Not Found)

Use the same code base for multiple browsers

Right now the add-on uses two copies of the same code to support multiple browser (Chrome and Firefox). This feels really ineficient. Double the work for each feature/bug fix.

There must be a better way to handle this. I don't have much experience building browser add-ons but this is worth investigating.
Maybe share the same core JavaScript files and use different sets of Manifest/Platform dependent files when "compiling" the extension.

This may also open the door to support more browsers easily.

Unable to copy user names

With the latest version of the Chat Client 2.2.6, you are unable to copy the user name by clicking on it.
This is an issue for both Chrome and Firefox versions.

(Tested on Chromium Version 83.0.4099.0 and Firefox Version 77.0.1)

Possible related to issue #55 that was recently closed.

Minified code preventing publication on Firefox Add-ons

We got an email from the Firefox Add-ons website (https://addons.mozilla.org/it/firefox/) letting us know that the extension can't be published as long as it contains minified code

This version contains obfuscated, minified, concatenated or otherwise machine-generated code. Please provide the original sources, together with instructions on how to generate the final XPI. Source code must be provided as an archive and uploaded using the source code upload field, which can be done during submission or on the version page in the developer hub

I think the issue comes from the presence of minified jquery code here, here and the markdown code here.

It'll have to be moved to separate files (jquery) and unminified before it can be published

cc @cTheDragons

Swear-Word Block Message Doesn't Display

Sorry if this is the wrong place to put this!

With the implementation of the new swear-word blocker, messages containing a banned word posted to the Tavern will be blocked from posting, and a pop-up will inform the user as to why it's blocked.

Messages posted to the Tavern through the chat extension are successfully blocked, but it triggers no pop-up.

Avatars not showing in Chat client since v1.4.0 Update

General Info

  • bc10ec41-4213-4482-bbb8-558e3c3ea8d5
  • Opera 37.0.2178.43
  • Windows 8.1 32-bit

Description

Avatars are no longer showing in the chat client. Not sure if it is an extension of the extra text we can see. (Looks like all 200).
See image below
chatavatarnotshowing

This is what it use to look like but the Avatars would eventually show not just not display.
Chat With Avatars

If it is could we have an option to turn it back on and have less text? It makes it easier for Socialite when answering questions based on how their Avatar is looking what level they are at without having to look up the stats. Also I like looking at everyone awesome costumes.

chat popup does not appear when user not in party (Chrome)

This bug occurs on the Chrome extension. I haven't tested for it on Firefox.

When my user account is not in a party, the chat pop-ups don't appear.

The console says:
Uncaught TypeError: Cannot read property 'getElementsByTagName' of undefined for chat_inPage.js:862

When I click on the script name in that message, the console takes me to this line in the extension's source code:

var groupDIVs = document.getElementsByClassName('groupsBox_content')[0].getElementsByTagName("div");

When I join a party and reload the website, the extension then works as expected. If I leave the party and reload again, the same error as above reappears, so it does seem related to being in a party.

Manual Setup impossible to use

It's impossible to use Manual Setup to link the Chat extension to Habitica account because it's impossible to select the link that is covered by the GitHub link. In combo with the automathic linking make the extension impossible to use
3758e9a8-b813-41bd-44d7-685f294c2150

Workaround that is not really intuitive: it's possible to select the link using the tab key on the keyboard to move between links.

Time is confusing

When 12-hour time is selected, midnight displays as 0:00 am (a little weird but still understandable), and noon displays as 12:00 am (confusing because 12 am is midnight).

Do not indent Bullet Points

When using markdown for bullet points, ie * or + at the beginning of the line. The chat client indents the bullet points squishing up the text. Please modify so it does not squish.

image

No Avatars

Even when "Disable Avatars for Faster Load" is unchecked, avatars don't appear for both me and other people. Tested in chrome and in firefox.

noAvatar

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.