Skip to content
Open
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
18 changes: 9 additions & 9 deletions webui-src/app/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const peopleUtil = require('people/people_util');

function loadLobbyDetails(id, apply) {
rs.rsJsonApiRequest(
'/rsMsgs/getChatLobbyInfo',
'/rsChats/getChatLobbyInfo',
{
id,
},
Expand Down Expand Up @@ -45,15 +45,15 @@ const ChatRoomsModel = {
// TODO: this doesn't preserve id of rooms,
// use regex on response to extract ids.
rs.rsJsonApiRequest(
'/rsMsgs/getListOfNearbyChatLobbies',
'/rsChats/getListOfNearbyChatLobbies',
{},
(data) => (ChatRoomsModel.allRooms = sortLobbies(data.public_lobbies))
);
},
loadSubscribedRooms(after = null) {
// ChatRoomsModel.subscribedRooms = {};
rs.rsJsonApiRequest(
'/rsMsgs/getChatLobbyList',
'/rsChats/getChatLobbyList',
{},
// JS uses double precision numbers of 64 bit. It is equivalent
// to 53 bits of precision. All large precision ints will
Expand Down Expand Up @@ -126,7 +126,7 @@ const ChatLobbyModel = {
setupAction: (lobbyId, nick) => {},
setIdentity(lobbyId, nick) {
rs.rsJsonApiRequest(
'/rsMsgs/setIdentityForChatLobby',
'/rsChats/setIdentityForChatLobby',
{},
() => m.route.set('/chat/:lobby_id', { lobbyId }),
true,
Expand All @@ -138,7 +138,7 @@ const ChatLobbyModel = {
enterPublicLobby(lobbyId, nick) {
console.info('joinVisibleChatLobby', nick, '@', lobbyId);
rs.rsJsonApiRequest(
'/rsMsgs/joinVisibleChatLobby',
'/rsChats/joinVisibleChatLobby',
{},
() => {
loadLobbyDetails(lobbyId, (info) => {
Expand All @@ -157,7 +157,7 @@ const ChatLobbyModel = {
unsubscribeChatLobby(lobbyId, follow) {
console.info('unsubscribe lobby', lobbyId);
rs.rsJsonApiRequest(
'/rsMsgs/unsubscribeChatLobby',
'/rsChats/unsubscribeChatLobby',
{},
() => ChatRoomsModel.loadSubscribedRooms(follow),
true,
Expand Down Expand Up @@ -212,7 +212,7 @@ const ChatLobbyModel = {
},
sendMessage(msg, onsuccess) {
rs.rsJsonApiRequest(
'/rsmsgs/sendChat',
'/rsChats/sendChat',
{},
() => {
// adding own message to log
Expand Down Expand Up @@ -466,7 +466,7 @@ const LayoutSetup = () => {
};

/*
/rsMsgs/initiateDistantChatConnexion
/rsChats/initiateDistantChatConnexion
* @param[in] to_pid RsGxsId to start the connection
* @param[in] from_pid owned RsGxsId who start the connection
* @param[out] pid distant chat id
Expand All @@ -488,7 +488,7 @@ const LayoutCreateDistant = () => {
{
onclick: () =>
rs.rsJsonApiRequest(
'/rsMsgs/initiateDistantChatConnexion',
'/rsChats/initiateDistantChatConnexion',
{
to_pid: m.route.param('lobby'),
from_pid: id,
Expand Down
12 changes: 6 additions & 6 deletions webui-src/app/config/config_mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ async function handleSubmit(tagId) {
if (tagNameAlreadyExists) {
alert('Tag Name Already Exists');
} else {
rs.rsJsonApiRequest('/rsMsgs/setMessageTagType', {
rs.rsJsonApiRequest('/rsMail/setMessageTagType', {
tagId: msgTagObj.tagId,
text: msgTagObj.tagName,
rgb_color: parseInt(msgTagObj.tagColor.substring(1), 16),
});
modalContainer.style.display = 'none';
rs.rsJsonApiRequest('/rsMsgs/getMessageTagTypes').then((res) => (tagArr = res.body.tags.types));
rs.rsJsonApiRequest('/rsMail/getMessageTagTypes').then((res) => (tagArr = res.body.tags.types));
}
}

Expand Down Expand Up @@ -68,10 +68,10 @@ const Mail = () => {
let distantMessagingPermissionFlag = 0;
return {
oninit: () => {
rs.rsJsonApiRequest('/rsMsgs/getMessageTagTypes').then(
rs.rsJsonApiRequest('/rsMail/getMessageTagTypes').then(
(res) => (tagArr = res.body.tags.types)
);
rs.rsJsonApiRequest('/rsMsgs/getDistantMessagingPermissionFlags').then(
rs.rsJsonApiRequest('/rsMail/getDistantMessagingPermissionFlags').then(
(res) => (distantMessagingPermissionFlag = res.body.retval)
);
},
Expand All @@ -87,7 +87,7 @@ const Mail = () => {
value: distantMessagingPermissionFlag,
oninput: (e) => (distantMessagingPermissionFlag = e.target.value),
onchange: () => {
rs.rsJsonApiRequest('/rsMsgs/setDistantMessagingPermissionFlags', {
rs.rsJsonApiRequest('/rsMail/setDistantMessagingPermissionFlags', {
flags: parseInt(distantMessagingPermissionFlag),
});
},
Expand Down Expand Up @@ -164,7 +164,7 @@ const Mail = () => {
'button.red',
{
onclick: () => {
rs.rsJsonApiRequest('/rsMsgs/removeMessageTagType', {
rs.rsJsonApiRequest('/rsMail/removeMessageTagType', {
tagId: tag.key,
}).then((res) => {
if (res.body.retval)
Expand Down
2 changes: 1 addition & 1 deletion webui-src/app/mail/mail_attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Layout = () => {
return {
oninit: (v) => {
v.attrs.list.forEach(async (element) => {
const res = await rs.rsJsonApiRequest('/rsMsgs/getMessage', {
const res = await rs.rsJsonApiRequest('/rsMail/getMessage', {
msgId: element.msgId,
});
if (res.body.retval) {
Expand Down
2 changes: 1 addition & 1 deletion webui-src/app/mail/mail_compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const Layout = () => {
const { identity: from, subject } = Data;
const mailBodyElement = document.querySelector('#composerMailBody');
const mailBody = `<div>${mailBodyElement.innerHTML}</div>`;
rs.rsJsonApiRequest('/rsMsgs/sendMail', { from, subject, mailBody, to, cc, bcc }).then(
rs.rsJsonApiRequest('/rsMail/sendMail', { from, subject, mailBody, to, cc, bcc }).then(
(res) => {
if (res.body.retval) {
Object.keys(Data.recipients).forEach((recipientType) => {
Expand Down
2 changes: 1 addition & 1 deletion webui-src/app/mail/mail_resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Messages = {
todo: [],
later: [],
load() {
rs.rsJsonApiRequest('/rsMsgs/getMessageSummaries', { box: util.BOX_ALL }, (data) => {
rs.rsJsonApiRequest('/rsMail/getMessageSummaries', { box: util.BOX_ALL }, (data) => {
Messages.all = data.msgList;
Messages.inbox = Messages.all.filter(
(msg) => (msg.msgflags & util.RS_MSG_BOXMASK) === util.RS_MSG_INBOX
Expand Down
12 changes: 6 additions & 6 deletions webui-src/app/mail/mail_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const widget = require('widgets');
const peopleUtil = require('people/people_util');
const compose = require('mail/mail_compose');

// rsmsgs.h
// rsmail.h
const RS_MSG_BOXMASK = 0x000f;

const RS_MSG_INBOX = 0x00;
Expand Down Expand Up @@ -52,14 +52,14 @@ const MessageSummary = () => {
let fromUserInfo;
function starMessage(e) {
isStarred = !isStarred;
rs.rsJsonApiRequest('/rsMsgs/MessageStar', { msgId: details.msgId, mark: isStarred });
rs.rsJsonApiRequest('/rsMail/MessageStar', { msgId: details.msgId, mark: isStarred });
// Stop event bubbling, both functions for supporting IE & FF
e.stopImmediatePropagation();
e.preventDefault();
}
return {
oninit: (v) => {
rs.rsJsonApiRequest('/rsMsgs/getMessage', {
rs.rsJsonApiRequest('/rsMail/getMessage', {
msgId: v.attrs.details.msgId,
})
.then((res) => {
Expand Down Expand Up @@ -175,8 +175,8 @@ const MessageView = () => {
files: [],
};
function deleteMail() {
rs.rsJsonApiRequest('/rsMsgs/MessageToTrash', { msgId: MailData.msgId, bTrash: true });
rs.rsJsonApiRequest('/rsMsgs/MessageDelete', { msgId: MailData.msgId }).then((res) => {
rs.rsJsonApiRequest('/rsMail/MessageToTrash', { msgId: MailData.msgId, bTrash: true });
rs.rsJsonApiRequest('/rsMail/MessageDelete', { msgId: MailData.msgId }).then((res) => {
widget.popupMessage(
m('.widget', [
m('.widget__heading', m('h3', res.body.retval ? 'Success' : 'Error')),
Expand All @@ -195,7 +195,7 @@ const MessageView = () => {

return {
oninit: async (v) => {
const res = await rs.rsJsonApiRequest('/rsMsgs/getMessage', {
const res = await rs.rsJsonApiRequest('/rsMail/getMessage', {
msgId: v.attrs.msgId,
});
if (res.body.retval) {
Expand Down
12 changes: 6 additions & 6 deletions webui-src/app/rswebui.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const RsEventsType = {
AUTHSSL_CONNECTION_AUTENTICATION: 3,

// @see pqissl
PEER_CONNECTION: 4,
PEER_STATE: 4,

// @see RsGxsChanges, used also in @see RsGxsBroadcast
GXS_CHANGES: 5,

// Emitted when a peer state changes, @see RsPeers
PEER_STATE_CHANGED: 6,
_________UNUSED___001_: 6,

// @see RsMailStatusEvent
MAIL_STATUS: 7,
Expand All @@ -45,8 +45,8 @@ const RsEventsType = {
// @see RsFiles
FILE_TRANSFER: 14,

// @see RsMsgs
CHAT_MESSAGE: 15,
// @see RsChats
CHAT_SERVICE: 15,

// @see rspeers.h
NETWORK: 16,
Expand All @@ -55,7 +55,7 @@ const RsEventsType = {
MAIL_TAG: 17,

/** Emitted to update library clients about file hashing being completed */
FILE_HASHING_COMPLETED: 20,
_________UNUSED___002_: 20,

// @see rspeers.h
TOR_MANAGER: 21,
Expand Down Expand Up @@ -169,7 +169,7 @@ function deeperIfExist(map, key, action) {

const eventQueue = {
events: {
[RsEventsType.CHAT_MESSAGE]: {
[RsEventsType.CHAT_SERVICE]: {
// Chat-Messages
types: {
// #define RS_CHAT_TYPE_PUBLIC 1
Expand Down