]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction_handlers.go
patch: v0.5.2
[rbdr/mobius] / hotline / transaction_handlers.go
index 20e7651019c6a7e39d3389aefdbbd5961df9cce6..f4c5a2fda080e349683ec78ee8d0fa9e615fcbff 100644 (file)
@@ -301,7 +301,7 @@ func HandleSendInstantMsg(cc *ClientConn, t *Transaction) (res []Transaction, er
        msg := t.GetField(fieldData)
        ID := t.GetField(fieldUserID)
 
-       reply := *NewTransaction(
+       reply := NewTransaction(
                tranServerMsg,
                &ID.Data,
                NewField(fieldData, msg.Data),
@@ -316,12 +316,12 @@ func HandleSendInstantMsg(cc *ClientConn, t *Transaction) (res []Transaction, er
                reply.Fields = append(reply.Fields, NewField(fieldQuotingMsg, t.GetField(fieldQuotingMsg).Data))
        }
 
-       res = append(res, reply)
+       res = append(res, *reply)
 
        id, _ := byteToInt(ID.Data)
-       otherClient := cc.Server.Clients[uint16(id)]
-       if otherClient == nil {
-               return res, errors.New("ohno")
+       otherClient, ok := cc.Server.Clients[uint16(id)]
+       if !ok {
+               return res, errors.New("invalid client ID")
        }
 
        // Respond with auto reply if other client has it enabled