~geb/sup

8fcbc2c1e78b8dadf1add16a1b9949a274987027 — John Gebbie 1 year, 11 months ago e5f98d2
fix typo
2 files changed, 12 insertions(+), 12 deletions(-)

M commands.go
M main.go
M commands.go => commands.go +7 -7
@@ 135,7 135,7 @@ func (app *App) createDirectChat(uid id.UserID) {
		} else {
			app.UI.Notify(ansi.Yellow, "Failed to set created room as direct chat: " + err.Error())
		}
		app.refreshRoomDetials(resp.RoomID)
		app.refreshRoomDetails(resp.RoomID)
	} else {
		app.UI.Notify(ansi.Red, "Failed to create direct chat: " + err.Error())
	}


@@ 147,7 147,7 @@ func (app *App) Create(roomName string) {
	resp, err := app.Client.CreateRoom(&req)
	if err == nil {
		app.UI.Notify(0, "Created " + roomName)
		app.refreshRoomDetials(resp.RoomID)
		app.refreshRoomDetails(resp.RoomID)
	} else {
		app.UI.Notify(ansi.Red, "Failed to create room: " + err.Error())
	}


@@ 336,7 336,7 @@ func (app *App) MakeDirectChat(user string) {
	app.UI.Accept()
	err := setAsDirectChat(app.Client, app.RoomID, uid)
	if err == nil {
		app.refreshRoomDetials(app.RoomID)
		app.refreshRoomDetails(app.RoomID)
		app.UI.Notify(0, "Set room as direct chat with " + string(uid))
	} else {
		app.UI.Notify(ansi.Red, "Failed to set as direct chat: " + err.Error())


@@ 347,7 347,7 @@ func (app *App) MakeGroupChat() {
	app.UI.Accept()
	err := unsetAsDirectChat(app.Client, app.RoomID)
	if err == nil {
		app.refreshRoomDetials(app.RoomID)
		app.refreshRoomDetails(app.RoomID)
		app.UI.Notify(0, "Set room as group chat")
	} else {
		app.UI.Notify(ansi.Red, "Failed to set as group chat: " + err.Error())


@@ 359,7 359,7 @@ func (app *App) MakeHistoryVisibility(hv event.HistoryVisibility) {
	c := event.HistoryVisibilityEventContent{HistoryVisibility: hv}
	_, err := app.Client.SendStateEvent(app.RoomID, event.StateHistoryVisibility, "", c)
	if err == nil {
		app.refreshRoomDetials(app.RoomID)
		app.refreshRoomDetails(app.RoomID)
	} else {
		app.UI.Notify(ansi.Red, "Failed to set history visibility: " + err.Error())
	}


@@ 370,7 370,7 @@ func (app *App) MakeJoinRule(jr event.JoinRule) {
	c := event.JoinRulesEventContent{JoinRule: jr}
	_, err := app.Client.SendStateEvent(app.RoomID, event.StateJoinRules, "", c)
	if err == nil {
		app.refreshRoomDetials(app.RoomID)
		app.refreshRoomDetails(app.RoomID)
	} else {
		app.UI.Notify(ansi.Red, "Failed to set access: " + err.Error())
	}


@@ 392,7 392,7 @@ func (app *App) MakeTopic(topic string) {
	c := event.TopicEventContent{Topic: topic}
	_, err := app.Client.SendStateEvent(app.RoomID, event.StateTopic, "", c)
	if err == nil {
		app.refreshRoomDetials(app.RoomID)
		app.refreshRoomDetails(app.RoomID)
	} else {
		app.UI.Notify(ansi.Red, "Failed to set topic: " + err.Error())
	}

M main.go => main.go +5 -5
@@ 264,7 264,7 @@ func (app *App) AddMessage(msg *Message) {
	}
}

func (app *App) refreshRoomDetials(rid id.RoomID) {
func (app *App) refreshRoomDetails(rid id.RoomID) {
	if app.Screen == RoomDescriptionScreen && app.RoomID == rid {
		app.roomDescriptionScreen(rid)
	}


@@ 371,11 371,11 @@ func (app *App) sync() chan func() {

	onEvent(event.StateEncryption, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)
		app.refreshRoomDetials(ev.RoomID)
		app.refreshRoomDetails(ev.RoomID)
	})
	onEvent(event.StateCanonicalAlias, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)
		app.refreshRoomDetials(ev.RoomID)
		app.refreshRoomDetails(ev.RoomID)
	})
	onEvent(event.StateCreate, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)


@@ 383,7 383,7 @@ func (app *App) sync() chan func() {
	})
	onEvent(event.StateHistoryVisibility, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)
		app.refreshRoomDetials(ev.RoomID)
		app.refreshRoomDetails(ev.RoomID)
	})
	onEvent(event.StateJoinRules, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)


@@ 401,7 401,7 @@ func (app *App) sync() chan func() {
	})
	onEvent(event.StateTopic, func(src mautrix.EventSource, ev *event.Event) {
		store(src, ev)
		app.refreshRoomDetials(ev.RoomID)
		app.refreshRoomDetails(ev.RoomID)
	})

	onEvent(event.EventEncrypted, func(src mautrix.EventSource, ev *event.Event) {