Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src-tauri/src/api/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) async fn getservers(token: String, username: String) -> String {
map.insert("token", token.clone());
map.insert("username", username.clone());
prelude::debug_only_print(&format!("getservers {}", token));
let res = post_to_text("https://onlinedi.vision/api/get_user_servers", map, "Failed to get use servers.")
let res = post_to_text("https://api.onlinedi.vision/api/get_user_servers", map, "Failed to get use servers.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand All @@ -18,7 +18,7 @@ pub(crate) async fn getservers(token: String, username: String) -> String {

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn get_server_info(server_id: String) -> String {
let res = get_to_text(&format!("https://onlinedi.vision/servers/{}/api/get_server_info",server_id), "Failed to get server info.")
let res = get_to_text(&format!("https://api.onlinedi.vision/servers/{}/api/get_server_info",server_id), "Failed to get server info.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand All @@ -40,7 +40,7 @@ pub(crate) async fn create_server(
map.insert("img_url", img_url.clone());
map.insert("token", token.clone());
prelude::debug_only_print(&map);
let res = post_to_text("https://onlinedi.vision/api/create_server", map, "Failed to create server.")
let res = post_to_text("https://api.onlinedi.vision/api/create_server", map, "Failed to create server.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/api/spell_caster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) async fn spellcheck(
map.insert("username", username.clone());
map.insert("key", key.clone());

let res = post_to_text("https://onlinedi.vision/api/spell/check", map, "Spell Check Failed").await
let res = post_to_text("https://api.onlinedi.vision/api/spell/check", map, "Spell Check Failed").await
.expect("err");
prelude::debug_only_print(&res);
res
Expand Down
8 changes: 4 additions & 4 deletions src-tauri/src/api/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) async fn login(password: String, username: String) -> String {
map.insert("password", password.clone());
map.insert("username", username.clone());
prelude::debug_only_print(&username);
let res = post_to_text("https://onlinedi.vision/api/try_login", map, "Failed to Log in.")
let res = post_to_text("https://api.onlinedi.vision/api/try_login", map, "Failed to Log in.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand All @@ -23,7 +23,7 @@ pub(crate) async fn signup(password: String, username: String, email: String) ->
map.insert("username", username.clone());
map.insert("email", email.clone());
prelude::debug_only_print(&username);
let res = post_to_text("https://onlinedi.vision/api/new_user", map, "Failed to create new user.")
let res = post_to_text("https://api.onlinedi.vision/api/new_user", map, "Failed to create new user.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand All @@ -38,7 +38,7 @@ pub(crate) async fn get_profile_pic(
let mut map = std::collections::HashMap::new();
map.insert("username", username.clone());
map.insert("token", token.clone());
let res = post_to_text("https://onlinedi.vision/api/get_user_pfp", map, "Failed to get PFP.")
let res = post_to_text("https://api.onlinedi.vision/api/get_user_pfp", map, "Failed to get PFP.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand All @@ -55,7 +55,7 @@ pub(crate) async fn set_profile_pic(
map.insert("username", username.clone());
map.insert("token", token.clone());
map.insert("img_url", img_url.clone());
let res = post_to_text("https://onlinedi.vision/api/set_user_pfp", map, "Failed to set profile pic.")
let res = post_to_text("https://api.onlinedi.vision/api/set_user_pfp", map, "Failed to set profile pic.")
.await
.expect("err");
prelude::debug_only_print(&res);
Expand Down
28 changes: 14 additions & 14 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export default {
console.log(err);
})
this.appState.push({ 'serverID': servers['s_list'][i], 'storedChannels': [], 'serverUsers': [] });
invoke('getchannels', { host_url: 'https://onlinedi.vision/servers', token: token, server: servers['s_list'][i], username: this.username })
invoke('getchannels', { host_url: 'https://api.onlinedi.vision/servers', token: token, server: servers['s_list'][i], username: this.username })
.then((res) => {
let channels = JSON.parse(res)['c_list'];
for (let j = 0; j < channels.length; j++) {
invoke('getmessages', { host_url: 'https://onlinedi.vision/servers', token: token, server: servers['s_list'][i], channel: channels[j]['channel_name'], username: this.username })
invoke('getmessages', { host_url: 'https://api.onlinedi.vision/servers', token: token, server: servers['s_list'][i], channel: channels[j]['channel_name'], username: this.username })
.then((res) => {
this.appState[this.appState.findIndex(obj => obj.serverID == servers['s_list'][i])].storedChannels.push({ 'channelTag': channels[j]['channel_name'], 'messages': JSON.parse(res)['m_list'] });
this.storedChannels.push({ 'serverID': servers['s_list'][i], 'channelTag': channels[j]['channel_name'], 'messages': JSON.parse(res)['m_list'] })
Expand All @@ -45,7 +45,7 @@ export default {
});

}
invoke('get_server_users', { host_url: 'https://onlinedi.vision/servers', token: token, server: servers['s_list'][i], username: this.username })
invoke('get_server_users', { host_url: 'https://api.onlinedi.vision/servers', token: token, server: servers['s_list'][i], username: this.username })
.then((res) => {
let users = JSON.parse(res)['u_list'];
for (let user_iter = 0; user_iter < users.length; user_iter++) {
Expand Down Expand Up @@ -90,7 +90,7 @@ export default {
userServers: [{
'serverID': '1',
'name': 'Welcome',
'img_url': 'https://onlinedi.vision/cdn/test/stest.jpeg',
'img_url': '',
Comment thread
catyuzu23 marked this conversation as resolved.
'desc': 'Welcome!'
}],
appState: [{
Expand Down Expand Up @@ -162,7 +162,7 @@ export default {
if(this.ws !== null ) {
this.ws.send(this.serverID + ':' + this.textChannel + ':' + this.username +':' + message);
}
invoke('sendmessage', { host_url: 'https://onlinedi.vision/servers', token: this.token, channel: this.textChannel, server: this.serverID, m_content: message, username: this.username })
invoke('sendmessage', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, channel: this.textChannel, server: this.serverID, m_content: message, username: this.username })
.then(() => {
this.message = '';
this.clearSelectedFile();
Expand All @@ -186,7 +186,7 @@ export default {
if(this.ws !== null ) {
this.ws.send(this.serverID + ':' + this.textChannel + ':' + this.username +':' + message);
}
invoke('sendmessage', { host_url: 'https://onlinedi.vision/servers', token: this.token, channel: this.textChannel, server: this.serverID, m_content: message, username: this.username })
invoke('sendmessage', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, channel: this.textChannel, server: this.serverID, m_content: message, username: this.username })
.then(() => {
this.message = '';
}).catch((err) => {
Expand Down Expand Up @@ -215,11 +215,11 @@ export default {
console.log(err);
})
this.appState.push({ 'serverID': servers['s_list'][i], 'storedChannels': [] });
invoke('getchannels', { host_url: 'https://onlinedi.vision/servers', token: this.token, server: servers['s_list'][i], username: this.username })
invoke('getchannels', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, server: servers['s_list'][i], username: this.username })
.then((res) => {
let channels = JSON.parse(res)['c_list'];
for (let j = 0; j < channels.length; j++) {
invoke('getmessages', { host_url: 'https://onlinedi.vision/servers', token: this.token, server: servers['s_list'][i], channel: channels[j]['channel_name'], username: this.username })
invoke('getmessages', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, server: servers['s_list'][i], channel: channels[j]['channel_name'], username: this.username })
.then((res) => {

this.appState[this.appState.findIndex(obj => obj.serverID == servers['s_list'][i])].storedChannels.push({ 'channelTag': channels[j]['channel_name'], 'messages': JSON.parse(res)['m_list'] });
Expand Down Expand Up @@ -307,7 +307,7 @@ export default {
this.settingsOpen = false;
},
get_messages(channel, server, token) {
invoke('getmessages', { host_url: 'https://onlinedi.vision/servers', token: token, server: server, channel: channel })
invoke('getmessages', { host_url: 'https://api.onlinedi.vision/servers', token: token, server: server, channel: channel })
.then((res) => {
console.log(res);
})
Expand Down Expand Up @@ -349,7 +349,7 @@ export default {
},
createChannel() {
if(this.nchn.length > 15) return;
invoke('create_channel', { host_url: 'https://onlinedi.vision/servers', "username": this.username, "server_id": this.serverID, "token": this.token, "channel_name": this.nchn })
invoke('create_channel', { host_url: 'https://api.onlinedi.vision/servers', "username": this.username, "server_id": this.serverID, "token": this.token, "channel_name": this.nchn })
.then((res) => {
this.token = JSON.parse(res)['token'];
this.appState[this.appState.findIndex(obj => obj.serverID === this.serverID)].storedChannels.push({ 'channelTag': this.nchn, 'messages': [] });
Expand All @@ -364,7 +364,7 @@ export default {
});
},
deleteChannel(sid, channelName) {
invoke("delete_channel", { host_url: 'https://onlinedi.vision/servers', "username": this.username, "server_id": sid, "token": this.token, "channel_name": channelName })
invoke("delete_channel", { host_url: 'https://api.onlinedi.vision/servers', "username": this.username, "server_id": sid, "token": this.token, "channel_name": channelName })
.then((res) => {
if(res == "Channel deleted successfully") {
this.appState[this.appState.findIndex(obj => obj.serverID === sid)].storedChannels =
Expand Down Expand Up @@ -394,15 +394,15 @@ export default {
})

this.appState.push({ 'serverID': new_sid, 'storedChannels': [], 'serverUsers': [] });
invoke('getchannels', { host_url: 'https://onlinedi.vision/servers', token: this.token, server: new_sid, username: this.username })
invoke('getchannels', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, server: new_sid, username: this.username })
.then((res) => {
let channels = JSON.parse(res)['c_list'];
for (let j = 0; j < channels.length; j++) {
this.appState[this.appState.findIndex(obj => obj.serverID == new_sid)].storedChannels.push({ 'channelTag': channels[j]['channel_name'], 'messages': []});
this.storedChannels.push({ 'serverID': new_sid, 'channelTag': channels[j]['channel_name'], 'messages': []})
}

invoke('get_server_users', { host_url: 'https://onlinedi.vision/servers', token: this.token, server: new_sid, username: this.username })
invoke('get_server_users', { host_url: 'https://api.onlinedi.vision/servers', token: this.token, server: new_sid, username: this.username })
.then((res) => {
let users = JSON.parse(res)['u_list'];
for (let user_iter = 0; user_iter < users.length; user_iter++) {
Expand All @@ -427,7 +427,7 @@ export default {
this.showSIDvar = !this.showSIDvar;
},
joinServer() {
invoke('join_server', { host_url: 'https://onlinedi.vision/servers', "username": this.username, "token": this.token, "server_id": this.joinserverID })
invoke('join_server', { host_url: 'https://api.onlinedi.vision/servers', "username": this.username, "token": this.token, "server_id": this.joinserverID })
.then((res) => {
this.token = JSON.parse(res)['token'];
invoke('write_credentials', { creds: JSON.stringify({ 'username': this.username, 'token': this.token }) })
Expand Down