Commit 97f636e2 authored by Haelwenn's avatar Haelwenn

Use the instance max_toot_chars or fallback to 5000

Closes: #8
parent e0a81fad
Pipeline #22182 passed with stage
in 1 minute and 17 seconds
......@@ -46,13 +46,23 @@ ApplicationWindow {
console.log('confLoaded')
//console.log(JSON.stringify(Logic.conf))
if (!Logic.conf['notificationLastID'])
Logic.conf['notificationLastID'] = 0
Logic.conf['notificationLastID'] = 0;
if (Logic.conf['instance']) {
Logic.api = new Logic.MastodonAPI({
"instance": Logic.conf['instance'],
"api_user_token": ""
})
}
Logic.api.get('instance', [], function (data) {
if(data.max_toot_chars && data.max_toot_chars > 499) {
Logic.conf['max_toot_chars'] = data.max_toot_chars;
} else {
Logic.conf['max_toot_chars'] = 5000;
}
})
if (Logic.conf['login']) {
//Logic.conf['notificationLastID'] = 0
Logic.api.setConfig("api_user_token", Logic.conf['api_user_token'])
......
......@@ -13,8 +13,7 @@ Page {
property string suggestedUser: ""
property ListModel suggestedModel
property string toot_id: ""
// TODO: Get the instance max chars
property int tootMaxChar: 500
property int tootMaxChar: Logic.conf['max_toot_chars']
property ListModel mdl
allowedOrientations: Orientation.All
onSuggestedUserChanged: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment