Browse Source

fix incorrect vhost serialization

tags/v2.5.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
e994e0451a
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      irc/import.go

+ 10
- 1
irc/import.go View File

@@ -113,7 +113,16 @@ func doImportDBGeneric(config *Config, dbImport databaseImport, credsType Creden
113 113
 		tx.Set(fmt.Sprintf(keyAccountCredentials, cfUsername), string(marshaledCredentials), nil)
114 114
 		tx.Set(fmt.Sprintf(keyAccountRegTime, cfUsername), strconv.FormatInt(userInfo.RegisteredAt, 10), nil)
115 115
 		if userInfo.Vhost != "" {
116
-			tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), userInfo.Vhost, nil)
116
+			vhinfo := VHostInfo{
117
+				Enabled:       true,
118
+				ApprovedVHost: userInfo.Vhost,
119
+			}
120
+			vhBytes, err := json.Marshal(vhinfo)
121
+			if err == nil {
122
+				tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), string(vhBytes), nil)
123
+			} else {
124
+				log.Printf("couldn't serialize vhost for %s: %v\n", username, err)
125
+			}
117 126
 		}
118 127
 		if len(userInfo.AdditionalNicks) != 0 {
119 128
 			tx.Set(fmt.Sprintf(keyAccountAdditionalNicks, cfUsername), marshalReservedNicks(userInfo.AdditionalNicks), nil)

Loading…
Cancel
Save