-
Notifications
You must be signed in to change notification settings - Fork 3
For developers
This page is aimed at providing information regarding the structure of the application for those that seek to better understand it.
If you notice any kind of issue with the application, please be sure to open a ticket: Issues
When releasing a new version with an updated database:
- Increment
SqlDatabase::DatabaseVersion - Implement
SqlDatabase::updateDatabase, updating it depending on former version
This way, any new releases will be able to update the old database files and users will not experience any inconvenience in switching to a new release.
The Imgur API limits the posting of comments to 6 per minute at most. Since this limit should be used as efficiently as possible, there is one single class that handles posting comments. There are 3 different kinds of comment-requests.
- Feedback Request
Single comment only. The application depends on knowing that this comment was posted and also requires the id of the comment. These have the highest priority when handling comments to minimize the amount of time the application has to wait. These feedback-requests are not stored and will cease to exist should the application close. - Simple Comment Request
Just a comment request. Can be any number of comments. Has the second-highest priority. These will be stored in the database and resume to be posted should the application close. - Tag Request
This is a collection of comments pertaining to tag commands. There can only be a select number of Tag Requests active at the same time. Any Tag Requests will be stored in the database and only removed once a post has been considered completely tagged.
Commands have been implemented in a way to allow for comparatively easy expansion into other services (should Imgur and Discord themselves not be good enough). At first, this would require one to create a new CommandInformation implementation for the new service.
CommandInformation can also implement FileTransferable if it is capable of transferring files across its medium.
The actual Command structure starts with a call to CommandRecognition that is able to ascertain whether a command was actually called (by checking it with the specified Prefix for the chosen service). If a command was recognized, CommandRecognition will cut off any information before the prefix (including the prefix itself) and let CommandHandler execute the command.
CommandHandler in turn compares the command request with the known commands that are stored. These commands are initialized in CommandHandler::initializeCommandMap().
The application has been made with the thought in mind that it should be possible to shut it down at any given moment and have it resume functionality at a later date. To this extend, several measures have been implemented.
- Tracker bookmarks
Imgur comments are kept track of with aTrackerBookmark. Even if the application closes, it will know which comments it still needs to scan. These are stored withCommentScannerStorage. - Tag request storage
Whenever a tag request is started, it is first added to a queue in the database. Then from this queue, it is handled until deemed completed. Only after completion is the tag request deleted.
For most kinds of data there is explicit database storage in place
- Plain comments (not pertaining to tag-requests). These are stored in
SimpleCommentRequestStorage - Comment deletion. These are stored in
CommentDeletionStorage.




