mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Merge pull request #100 from RetroShare/v0.6-MailChat
rsMsgs -> (rsMail | rsChats)
This commit is contained in:
commit
dee891d7e4
@ -6,7 +6,7 @@ const peopleUtil = require('people/people_util');
|
||||
|
||||
function loadLobbyDetails(id, apply) {
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsMsgs/getChatLobbyInfo',
|
||||
'/rsChats/getChatLobbyInfo',
|
||||
{
|
||||
id,
|
||||
},
|
||||
@ -45,7 +45,7 @@ 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))
|
||||
);
|
||||
@ -53,7 +53,7 @@ const ChatRoomsModel = {
|
||||
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
|
||||
@ -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,
|
||||
@ -138,7 +138,7 @@ const ChatLobbyModel = {
|
||||
enterPublicLobby(lobbyId, nick) {
|
||||
console.info('joinVisibleChatLobby', nick, '@', lobbyId);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsMsgs/joinVisibleChatLobby',
|
||||
'/rsChats/joinVisibleChatLobby',
|
||||
{},
|
||||
() => {
|
||||
loadLobbyDetails(lobbyId, (info) => {
|
||||
@ -157,7 +157,7 @@ const ChatLobbyModel = {
|
||||
unsubscribeChatLobby(lobbyId, follow) {
|
||||
console.info('unsubscribe lobby', lobbyId);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsMsgs/unsubscribeChatLobby',
|
||||
'/rsChats/unsubscribeChatLobby',
|
||||
{},
|
||||
() => ChatRoomsModel.loadSubscribedRooms(follow),
|
||||
true,
|
||||
@ -212,7 +212,7 @@ const ChatLobbyModel = {
|
||||
},
|
||||
sendMessage(msg, onsuccess) {
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsmsgs/sendChat',
|
||||
'/rsChats/sendChat',
|
||||
{},
|
||||
() => {
|
||||
// adding own message to log
|
||||
@ -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
|
||||
@ -488,7 +488,7 @@ const LayoutCreateDistant = () => {
|
||||
{
|
||||
onclick: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsMsgs/initiateDistantChatConnexion',
|
||||
'/rsChats/initiateDistantChatConnexion',
|
||||
{
|
||||
to_pid: m.route.param('lobby'),
|
||||
from_pid: id,
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
);
|
||||
},
|
||||
@ -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),
|
||||
});
|
||||
},
|
||||
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -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) => {
|
||||
@ -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')),
|
||||
@ -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) {
|
||||
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user