weechatRN

Weechat relay client for iOS using websockets https://github.com/mhoran/weechatRN
git clone http://git.hanabi.in/repos/weechatRN.git
Log | Files | Refs | README | LICENSE

commit 9e299b76751dddf1a3d2bb53f6238808ccbbeee9
parent 4fa19258081afe1f1507b8ad47850a6f2f3ca204
Author: Matthew Horan <matt@matthoran.com>
Date:   Sat, 10 Nov 2018 18:16:34 -0500

Ignore hotlist for current buffer

On reconnect, we fetch the hotlist. The hotlist includes message counts
for all channels, including the current buffer. This excludes the
current buffer (if there is one) from the hotlist.

Diffstat:
Msrc/lib/weechat/action_transformer.ts | 3++-
Msrc/store/hotlists.ts | 4++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/weechat/action_transformer.ts b/src/lib/weechat/action_transformer.ts @@ -137,7 +137,8 @@ export const transformToReduxAction = (data: WeechatResponse<any>) => { const sum = message + privmsg + highlight; return { ...h, message, privmsg, highlight, sum }; } - ) + ), + currentBufferId: state.app.currentBufferId }; } case "nicklist": { diff --git a/src/store/hotlists.ts b/src/store/hotlists.ts @@ -8,6 +8,10 @@ const initialState: HotListState = {}; export default (state: HotListState = initialState, action): HotListState => { switch (action.type) { case "FETCH_HOTLISTS": + if (action.currentBufferId) { + return omit(action.payload, currentBufferId); + } + return action.payload; case "CHANGE_CURRENT_BUFFER": return omit(state, action.bufferId);