Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the room name to room urls. #154

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion client/routes/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Router.route '/home',
KonchatNotification.getDesktopPermission()


Router.route '/room/:_id',
Router.route '/room/:_id/:name?',
name: 'room'

waitOn: ->
Expand Down
6 changes: 3 additions & 3 deletions client/views/app/chatWindowDashboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ Template.chatWindowDashboard.events
return Errors.throw error.reason

if result?.rid?
Router.go('room', { _id: result.rid })
Router.go('room', { _id: result.rid, name: result.name})

'click button.load-more': (e) ->
RoomHistoryManager.getMore this._id
Expand Down Expand Up @@ -403,10 +403,10 @@ Template.chatWindowDashboard.events
return Errors.throw error.reason

if result?.rid?
Router.go('room', { _id: result.rid })
Router.go('room', { _id: result.rid, name: result.name})
$('#room-search').val('')
else
Router.go('room', { _id: doc.rid })
Router.go('room', { _id: doc.rid, name: doc.name })
$('#room-search').val('')

'scroll .wrapper': (e, instance) ->
Expand Down
2 changes: 1 addition & 1 deletion client/views/app/sideNav/chatRoomItem.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template name="chatRoomItem">
<li class="link-room-{{rid}} {{active}} {{#if unread}}has-unread{{/if}}">
<a href="{{ pathFor 'room' _id=rid}}" title="{{name}}">
<a href="{{ pathFor 'room' _id=rid name=name}}" title="{{name}}">
{{#if unread}}
<span class="unread">{{unread}}</span>
{{/if}}
Expand Down
7 changes: 4 additions & 3 deletions client/views/app/sideNav/createChannelFlex.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ Template.createChannelFlex.events

'click .save-channel': (e, instance) ->
err = SideNav.validate()
instance.roomName.set instance.find('#channel-name').value
roomName = instance.find('#channel-name').value
instance.roomName.set roomName
console.log err
if not err
Meteor.call 'createChannel', instance.find('#channel-name').value, instance.selectedUsers.get(), (err, result) ->
Meteor.call 'createChannel', roomName, instance.selectedUsers.get(), (err, result) ->
if err
console.log err
if err.error is 'name-invalid'
Expand All @@ -79,7 +80,7 @@ Template.createChannelFlex.events

instance.clearForm()

Router.go 'room', { _id: result.rid }
Router.go 'room', { _id: result.rid, name: roomName }
else
instance.error.set({ fields: err })

Expand Down
5 changes: 3 additions & 2 deletions client/views/app/sideNav/privateGroupsFlex.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ Template.privateGroupsFlex.events
'click .save-pvt-group': (e, instance) ->
err = SideNav.validate()
if not err
Meteor.call 'createPrivateGroup', instance.find('#pvt-group-name').value, instance.selectedUsers.get(), (err, result) ->
groupName = instance.find('#pvt-group-name').value
Meteor.call 'createPrivateGroup', groupName, instance.selectedUsers.get(), (err, result) ->
if err
return toastr.error err.reason
SideNav.closeFlex()
instance.clearForm()
Router.go 'room', { _id: result.rid }
Router.go 'room', { _id: result.rid, name: groupName }
else
Template.instance().error.set(err)

Expand Down